Description Usage Arguments Value Note See Also Examples
This function is meant to be used by R developers that have to make simultaneous updates to many packages.
1 |
packages |
character. A character vector of package names.
These must be directories relative to |
dir |
character. The root directory on which to iterate over all the packages. By default, the current working directory. |
f |
function. The function to apply to each package.
The argument the function receives is
|
A list where each element is the result of f
applied
to the respective package.
The argument pkg
received by the function call on each iteration is
devtools::as.package(pkg_path)
, which has a $path
available
and whose other attributes originate directly from the package's DESCRIPTION
file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# You can use pkgapply to iterate over each package and apply some
# operation.
pkgapply(c('package1', 'package2'), dir = '/root/dir', function(pkg) { ... })
pkgapply(c('package1', 'package2'), function(pkg) { ... })
# If you leave the package names blank, it will loop over all directories
# relative to `dir` that contain a DESCRIPTION file and are thus recognized
# as being R packages.
pkgapply(dir = '/root/dir', function(pkg) { ... })
# If you do not provide a directory, the current directory will be used.
pkgapply(function(pkg) { ... })
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.