Description Usage Arguments Value Examples
This will replace a dependency in a DESCRIPTION file, ignoring the parens
1 2 |
from |
a dependency to remove (sans parenthetical version) |
to |
the depenency to replace (parenthetical version optional) |
field |
Which field should be modified (defaults to "Imports") |
file |
The DESCRIPTION file. |
write |
a logical. If 'TRUE', DESCRIPTION file will be overwritten, if 'FALSE', the file will be printed to screen. |
if 'write = TRUE', the specified file will be modified. If 'write = FALSE', the proposed changes.
1 2 3 4 5 | tmp <- tempdir()
add(c("utils", "stats", "grDEvices (>= 3.0.0)"), file = file.path(tmp, "DESCRIPTION"), write = TRUE)
write.dcf(read.dcf(file.path(tmp, "DESCRIPTION")))
# Whoops! we misspelled grDevices. We can replace it.
replace("grDEvices", "grDevices (>= 3.4.0)", file = file.path(tmp, "DESCRIPTION"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.