|
7 | 7 | #' Each package is written to a separate line |
8 | 8 | #' as a standard [library()] call (e.g. `library(package)`) so |
9 | 9 | #' `renv` can identify them automatically. |
| 10 | +#' The following packages are included: |
| 11 | +#' |
| 12 | +#' * Packages listed in the `packages` argument of [tar_target()] |
| 13 | +#' or [tar_option_set()]. |
| 14 | +#' * Packages required by the `format` set in [tar_target()] |
| 15 | +#' or [tar_option_set()]. |
| 16 | +#' * Packages directly listed in the `extras` argument of [tar_renv()]. |
| 17 | +#' |
10 | 18 | #' @details This function gets called for its side-effect, which writes |
11 | 19 | #' package dependencies to a script for compatibility with `renv`. |
12 | 20 | #' The generated file should __not__ be edited by hand and will be |
|
16 | 24 | #' and keep a record of project dependencies in a file called `renv.lock`. |
17 | 25 | #' To identify dependencies, `renv` crawls through code to find packages |
18 | 26 | #' explicitly mentioned using `library()`, `require()`, or `::`. |
19 | | -#' However, `targets` manages packages in a way that hides dependencies |
20 | | -#' from `renv.` `tar_renv()` finds package dependencies that would be |
21 | | -#' otherwise hidden to `renv` because they are declared using the `targets` |
22 | | -#' API. Thus, calling `tar_renv` this is only necessary if using |
23 | | -#' [`tar_option_set()`] or [`tar_target()`] to use specialized storage |
24 | | -#' formats or manage packages. |
| 27 | +#' However, `targets` pipelines introduce extra package dependencies |
| 28 | +#' through the `packages` and `format` arguments of |
| 29 | +#' [tar_option_set()] and [tar_target()]. |
| 30 | +#' [tar_renv()] writes a special R script which allows these extra packages |
| 31 | +#' (along with packages listed in `extras`) to be detected by `renv`. |
25 | 32 | #' |
26 | 33 | #' With the script written by `tar_renv()`, `renv` is able to crawl the |
27 | 34 | #' file to identify package dependencies (with `renv::dependencies()`). |
|
42 | 49 | #' After confirming at |
43 | 50 | #' <https://rstudio.github.io/renv/reference/config.html> |
44 | 51 | #' that you can safely disable these checks, |
45 | | -#' you can write lines `RENV_CONFIG_RSPM_ENABLED=false`, |
46 | | -#' `RENV_CONFIG_SANDBOX_ENABLED=false`, |
| 52 | +#' you can write lines |
| 53 | +#' `RENV_CONFIG_SANDBOX_ENABLED=false` |
47 | 54 | #' and `RENV_CONFIG_SYNCHRONIZED_CHECK=false` |
48 | 55 | #' in your user-level `.Renviron` file. If you disable the synchronization |
49 | 56 | #' check, remember to call `renv::status()` periodically |
|
0 commit comments