Install the R package needed for your package after installation

I am developing an R package that depends on installing another R package on the users system.

I added the dependency file: pkgname in the DESCRIPTION file and imported (pkgname) into NAMESPACE. What I was hoping to do was check if pkgname was installed and if not install.packages (pkgname, repos = "CRAN or Rforge or wherever the package is"), if not.

However, when I try to install my package, I get an error message:

    ERROR: dependency 'pkgname' is not available for package 'mypkg'

Does anyone know how to implement the installation of pkgname, should pkgname no longer be on the system?

Many thanks

+5
source share
1 answer

R CMD INSTALL , . CRAN, , install.packages . install.packages .

R-forge, CRAN, , README . R, install.packages.

+4

All Articles