| create_dependencies_file | R Documentation |
inst folderCreate a dependencies.R in the inst folder
create_dependencies_file(
path = "DESCRIPTION",
field = c("Depends", "Imports"),
to = "inst/dependencies.R",
open_file = TRUE,
ignore_base = TRUE
)
path |
path to the DESCRIPTION file |
field |
DESCRIPTION field to parse, "Import" and "Depends" by default. Can add "Suggests" |
to |
path to dependencies.R. "inst/dependencies.R" by default |
open_file |
Logical. Open the file created in an editor |
ignore_base |
Logical. Whether to ignore package coming with base, as they cannot be installed |
Used for side effect. Shows a message with installation instructions and creates a R file containing these instructions.
tmpdir <- tempfile(pattern = "depsfile")
dir.create(tmpdir)
file.copy(system.file("dummypackage",package = "attachment"), tmpdir,
recursive = TRUE)
dummypackage <- file.path(tmpdir, "dummypackage")
# browseURL(dummypackage)
create_dependencies_file(path = file.path(dummypackage,"DESCRIPTION"),
to = file.path(dummypackage, "inst/dependencies.R"),
open_file = FALSE)
# Clean temp files after this example
unlink(tmpdir, recursive = TRUE)