add: Add dependencies to a DESCRIPTION file

Description Usage Arguments Value Examples

Description

Add dependencies to a DESCRIPTION file

Usage

1
2
add(replacements = c("utils", "stats", "grDevices"), field = "Imports",
  file = "DESCRIPTION", name = "myAnalysis", write = FALSE)

Arguments

replacements

A character string of packages to add/replace

field

Which field should be modified (defaults to "Imports")

file

The DESCRIPTION file.

name

The name of the project (in the case that the DESCRIPTION does not exist.)

write

a logical. If 'TRUE', DESCRIPTION file will be overwritten, if 'FALSE', the file will be printed to screen.

Value

if 'write = TRUE', NULL, if 'write = FALSE', the DESCRIPTION file will be printed to screen.

Examples

1
2
3
4
5
6
7
8
# a superficial example with this package's DESCRIPTION file
LIB <- .libPaths()[1]
pkg <- file.path(LIB, "diaper", "DESCRIPTION")
# note the Dependency version for R
write.dcf(read.dcf(pkg))
# now we change it to be 3.0
add(replacements = "R (>= 3.0.0)", field = "Depends",
    file = pkg, write = FALSE)

zkamvar/diaper documentation built on May 6, 2019, 12:04 a.m.