Skip to content

Commit

Permalink
Update advice to use use_standalone() (#1040)
Browse files Browse the repository at this point in the history
* Update advice to use `use_standalone()`

* Update dependencies-in-practice.Rmd

Co-authored-by: Jennifer (Jenny) Bryan <[email protected]>

---------

Co-authored-by: Jennifer (Jenny) Bryan <[email protected]>
  • Loading branch information
olivroy and jennybc authored Jan 17, 2024
1 parent d448b77 commit b6391ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dependencies-in-practice.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,12 @@ Here is a redacted version of glue's `.onLoad()` function, where you'll see that

The `s3_register()` function comes from the vctrs package.
If you don't have an organic need to depend on vctrs, it is common (and encouraged) to simply inline [the `s3_register()` source](https://github.com/r-lib/vctrs/blob/main/R/register-s3.R) into your own package.
One way to do this is with `usethis::use_standalone()`:

```r
usethis::use_standalone("r-lib/rlang", "s3-register")
```

You can't always copy code from other people's packages and paste it into yours, but you can in this case.
This usage is specifically allowed by the license of the source code of `s3_register()`.
This provides a great segue into @sec-license, which is all about licensing.

0 comments on commit b6391ae

Please sign in to comment.