I am trying to create a package. It depends on several packages. I added the imports to the namespace file and the Depends in the description file.
I found possible solutions here and here, but these didn't work- I think because I am on CentOS.
This is what I see on my screen:
[hadoop@localhost RProjects]$ sudo R CMD check TextPreProcess
* using log directory ‘/home/hadoop/RProjects/TextPreProcess.Rcheck’
* using R version 2.15.1 (2012-06-22)
* using platform: x86_64-redhat-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘TextPreProcess/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘TextPreProcess’ version ‘1.0’
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Packages required but not available:
‘RWeka’ ‘Snowball’ ‘lsa’ ‘plyr’ ‘snowfall’ ‘tau’ ‘tm’
See the information on DESCRIPTION files in the chapter ‘Creating R
packages’ of the ‘Writing R Extensions’ manual.
I went through Writing R Extentions but I couldn't derive a lot of insight as to how to solve my problem.
It's working now.
What I did was:
~/R/x86_64-redhat-linux-gnu-library/2.15
to .libPaths (That's where my R library was)R CMD check <pkg>
. Built it. R CMD build <pkg>
. Installed it. R CMD INSTALL <tarball>
.I had the same problem because packages were installed but for different R versions.
To solve, I opened the old R version (the one the package was built under), and installed the missing packages under that version and it solved the problem.
E.g.
# Version should match the version your package was built in
R.version
# 3.5.1
install.packages(c('stringr', 'lubridate', 'testthat'))
R.version
.rs.restartR()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With