I am trying to download the GGMAP package in R. during installation, it also downloads ggplot 2.1.0. I am getting an error, however, that the ggplot version required by ggmap is 2.2.0. How do I force ggplot to be the latest version?
> library(devtools)
> install_github("dkahle/ggmap")
Downloading GitHub repo dkahle/ggmap#master
from URL https://api.github.com/repos/dkahle/ggmap/zipball/master
Installing ggmap
"C:/PROGRA~1/MIE74D~1/RCLIEN~1/R_SERVER/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/dixi/AppData/Local/Temp/RtmpuYriTy/devtools2604499b1ebd/dkahle-ggmap-065fe6a" \
--library="C:/Users/dixi/Documents/R/win-library/3.3" --install-tests
* installing *source* package 'ggmap' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
Error : package 'ggplot2' 2.1.0 was found, but >= 2.2.0 is required by 'ggmap'
ERROR: lazy loading failed for package 'ggmap'
* removing 'C:/Users/dixi/Documents/R/win-library/3.3/ggmap'
* restoring previous 'C:/Users/dixi/Documents/R/win-library/3.3/ggmap'
Error: Command failed (1)
Related
So I have been hitting my head against the wall for a few days now trying to understand why my machine will not load choroplethrZip. I have tried the recommended installation pathway (with devtools and github) but I keep receiving the error message below:
#install.packages("devtools")
library(devtools)
install_github('arilamstein/choroplethrZip#v1.5.0')
Downloading GitHub repo arilamstein/choroplethrZip#v1.5.0
from URL https://api.github.com/repos/arilamstein/choroplethrZip/zipball/v1.5.0
Installing choroplethrZip
"C:/PROGRA~1/R/R-35~1.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/dbrennan/AppData/Local/Temp/Rtmp0q4jjY/devtools29fc168c68f5/arilamstein-choroplethrZip-3cbc9f3" \
--library="C:/Users/dbrennan/Documents/R/win-library/3.5" --install-tests
* installing *source* package 'choroplethrZip' ...
** R
** data
** inst
** tests
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'choroplethr' 2.2.0 is being loaded, but >= 3.3.0 is required
ERROR: lazy loading failed for package 'choroplethrZip'
* removing 'C:/Users/dbrennan/Documents/R/win-library/3.5/choroplethrZip'
In R CMD INSTALL
Installation failed: Command failed (1)
I have tried restarting r and running the code immediately, as well as restarting the computer itself. I have also tried to read the package zip file into R directly but that has not worked either. Any help would be greatly appreciated.
Buried within the error message is this:
namespace 'choroplethr' 2.2.0 is being loaded, but >= 3.3.0 is required
And in fact, if you look at the DESCRIPTION page of choroplethrZip you will see that it imports "choroplethr (>= 3.3.0)".
Since you only have version 2.2.0 installed, I recommend typing:
update.packages()
which will update all your packages. Then try installing and loading choroplethrZip again.
I'm trying to install the tscompdata package to R. This is a new one.
The installation is by the "devtools" package, using the following command:
devtools::install_github("robjhyndman/tscompdata")
and the output is:
Downloading GitHub repo robjhyndman/tscompdata#master from URL
https://api.github.com/repos/robjhyndman/tscompdata/zipball/master
Installing tscompdata '/usr/lib/R/bin/R' --no-site-file --no-environ
--no-save --no-restore --quiet CMD INSTALL \ '/tmp/RtmpjrsG7p/devtools45d14034ea55/robjhyndman-tscompdata-0329cec'
\ --library='/home/diego/R/x86_64-pc-linux-gnu-library/3.4'
--install-tests
* installing *source* package ‘tscompdata’ ...
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading Error : object ‘mstl’ is not exported by 'namespace:forecast' ERROR: lazy loading
failed for package ‘tscompdata’
* removing ‘/home/diego/R/x86_64-pc-linux-gnu-library/3.4/tscompdata’ Installation failed: Command failed (1)
did someone face this problem too?
By default when one is using install_github function from devtools package in R the vignettes of the installed package are not build. I've seen this questio with an answer which shows how to build vignettes if one desires to
Building R package from github: how to disable building vignettes?.
I wrote a package with such vignettes and but I recieve an error what installing directly from github like this:
> devtools::install_github("MarcinKosinski/RTCGA")
Downloading github repo MarcinKosinski/RTCGA#master
Installing RTCGA
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/RtmpCIboSY/devtools17de96523e5/MarcinKosinski-RTCGA-e47bdf6' \
--library='/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2' \
--install-tests
* installing *source* package ‘RTCGA’ ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RTCGA)
> browseVignettes("RTCGA")
No vignettes found by browseVignettes("RTCGA")
> ?devtools::install_github
> devtools::install_github("MarcinKosinski/RTCGA", build_vignettes= TRUE)
Downloading github repo MarcinKosinski/RTCGA#master
Installing RTCGA
'/usr/lib/R/bin/R' --vanilla CMD build \
'/tmp/RtmpCIboSY/devtools17de1905fc71/MarcinKosinski-RTCGA-e47bdf6' \
--no-resave-data --no-manual
* checking for file ‘/tmp/RtmpCIboSY/devtools17de1905fc71/MarcinKosinski-RTCGA-e47bdf6/DESCRIPTION’ ... OK
* preparing ‘RTCGA’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
Removed empty directory ‘RTCGA/ghPage’
Removed empty directory ‘RTCGA/inst’
* building ‘RTCGA_0.99.6.tar.gz’
'/usr/lib/R/bin/R' --vanilla CMD INSTALL \
'/tmp/RtmpCIboSY/RTCGA_0.99.6.tar.gz' \
--library='/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2' \
--install-tests
* installing *source* package ‘RTCGA’ ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
Warning in file(con, "w") :
cannot open file '/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing ‘/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA’
* restoring previous ‘/home/mkosinski/R/x86_64-pc-linux-gnu-library/3.2/RTCGA’
Error: Command failed (1)
When I build package from source locally there are no errors. Can anyone know what can be a cause of this?
I needed to add
.onLoad <- function(libname, pkgname) {
vig_list = tools::vignetteEngine(package = 'knitr')
vweave <- vig_list[['knitr::knitr']][c('weave')][[1]]
vtangle <- vig_list[['knitr::knitr']][c('tangle')][[1]]
tools::vignetteEngine(pkgname, weave = vweave, tangle = vtangle,
pattern = "[.]Rmd$", package = pkgname)
#register_vignette_engines(pkgname)
}
this function to zzz.R file in R/ directory and knitr package to Dependencies in DESCRIPTION file.
I am using devtools package to install R packages from GitHub. In the function's manual there is a sentence about repo parameter that the function is vectorized on that parameter
This function is vectorised on repo so you can install multiple packages in a single command.
I've created 5 packages and I distribute them on a single github repository in 5 different subdirectories. When I use such command to install all 5 of them in a single function call
> if (!require(devtools)) {
+ install.packages("devtools")
+ require(devtools)
+ }
> install_github(paste0("mi2-warsaw/RTCGA.data/",
+ subdir = paste0("RTCGA.",
+ c("clinical",
+ "rnaseq",
+ "mutations",
+ "cnv",
+ "PANCAN12")
+ )
+ )
+ )
Downloading github repo mi2-warsaw/RTCGA.data#master
Installing RTCGA.clinical
"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" --no-site-file --no-environ \
--no-save --no-restore CMD INSTALL \
"C:/Users/Marcin/AppData/Local/Temp/RtmpeSTVOR/devtoolse483660419b/mi2-warsaw-RTCGA.data-f38f079/RTCGA.clinical" \
--library="C:/Users/Marcin/Documents/R/win-library/3.2" \
--install-tests
* installing *source* package 'RTCGA.clinical' ...
** R
** data
*** moving datasets to lazyload DB
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (RTCGA.clinical)
Downloading github repo mi2-warsaw/RTCGA.data#master
Installing RTCGA.rnaseq
"C:/PROGRA~1/R/R-32~1.0/bin/x64/R" --no-site-file --no-environ \
--no-save --no-restore CMD INSTALL \
"C:/Users/Marcin/AppData/Local/Temp/RtmpeSTVOR/devtoolse4839392db6/mi2-warsaw-RTCGA.data-3c044a0/RTCGA.rnaseq" \
--library="C:/Users/Marcin/Documents/R/win-library/3.2" \
--install-tests
* installing *source* package 'RTCGA.rnaseq' ...
** R
** data
*** moving datasets to lazyload DB
it looks like for each single package's installation the whole repository is downloaded. So in a result the whole repository is downloaded 5 times...
Is there a way to download the repository once, and to install 5 packages then - if possible - in a one function call similar to the one I am using?
I am having difficulty installing the qdap library, see below:
I installed the Java library first, and then the qdap library:
Sys.setenv(JAVA_HOME='C:\Program Files (x86)\Java\jre7')
library(rJava)
then the devtools library:
library(devtools)
install_github("trinker/qdapDictionaries")
install_github("trinker/qdapRegex")
install_github("trinker/qdapTools")
install_github("trinker/qdap")
The other installations before qdap go fine, but at qdap this error is generated:
install_github("trinker/qdap")
Downloading github repo trinker/qdap#master
Installing qdap
Skipping 3 packages ahead of CRAN: qdapDictionaries, qdapRegex, qdapTools
"C:/PROGRA~1/R/R-32~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore \
CMD INSTALL \
"C:/Users/Seema/AppData/Local/Temp/RtmpMdVHCQ/devtools101432a84788/trinker-qdap-85cbe87" \
--library="C:/Users/Seema/Documents/R/win-library/3.2" --install-tests
installing source package 'qdap' ...
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries
Error: Command failed (1)
What dependent libraries is it looking for? Any help highly appreciated.