You can install the package from Github with
devtools::install_github("markusdumke/pkghelper")
Currently the package includes functions which scan the R code in the package for all packages in use and writes these packages to the Imports field of the DESCRIPTION file.
Together with devtools
and roxygen2
this package helps to make the R
package generation process more automatically.
library(pkghelper)
# Get names of packages my package depends on
get_dependencies()
#> [1] "desc" "devtools" "magrittr" "purrr" "stringr"
# Modify DESCRIPTION
write_dependencies()
#> Updating pkghelper DESCRIPTION
#> Type: Package
#> Package: pkghelper
#> Title: Manage package dependencies
#> Version: 0.1.0
#> Author: Markus Dumke
#> Maintainer: Markus Dumke <[email protected]>
#> Description: Fill Imports section in DESCRIPTION file of R package by
#> scanning code for used packages.
#> License: MIT + file LICENSE
#> Imports:
#> desc,
#> devtools,
#> magrittr,
#> purrr,
#> stringr
#> Encoding: UTF-8
#> LazyData: true
#> Roxygen: list(markdown = TRUE)
#> RoxygenNote: 6.1.0