问题
I created an R package and loaded it to github (microdadosBrasil). When I try to install the package (as a user would) I get the following error:
devtools::install_github("lucasmation/microdadosBrasil")
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘stringi’
I tried solving this by adding stringi to the package dependencies In DESCRIPTION in included:
Imports:
stringi
I also included the package import at NAMESPACE
import(stringi)
But, even then I get the same installation error.
To be hones I'm not even aware of any explicit function in my package that uses the stringi
package.
If I install stringi
before then the microdadosBrasil
installation works:
install.packages('stringi')
devtools::install_github("lucasmation/microdadosBrasil")
This is the session information when error occurs (before pre-installing stringi
)
sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.1.3
回答1:
The problem is due to dependencies of packages because one package calls file in another package and so on (like recursion). So first try to install all dependencies of the package then definitely this package will work.
来源:https://stackoverflow.com/questions/37705714/package-dependency-error-there-is-no-package-called-stringi