So, I have an R package x on github that I am installing.
library(devtools)
install_github("bla/bla")
The installation fails (see error printout below). Package x has a few dependencies including ggplot2. All dependencies of x are installed automatically including ggplot2, but a package scales, a dependency of ggplot2 was not installed. Therefore, it failed. So, dependencies of dependencies are not automatically installed.
In my description file, I use 'Depends' for ggplot2. I noticed in the ggplot2 description file that scales is under 'Imports', rather than 'Depends'.
I know I can fix all this my just manually installing scales, or manually installing dependent dependencies. But, is there a way to automatically install all dependencies? 'Depends' and 'Imports'? Or am I missing something?
See console print out below:
Installing 1 package: Cairo
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/Cairo_1.5-9.zip'
Content type 'application/zip' length 1026234 bytes (1002 KB)
downloaded 1002 KB
package ‘Cairo’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\rmf\AppData\Local\Temp\Rtmp8Eaf5a\downloaded_packages
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\rmf\AppData\Local\Temp\Rtmp8Eaf5a\downloaded_packages
Installing 1 package: gridExtra
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/gridExtra_2.2.1.zip'
Content type 'application/zip' length 483300 bytes (471 KB)
downloaded 471 KB
package ‘gridExtra’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\rmf\AppData\Local\Temp\Rtmp8Eaf5a\downloaded_packages
Installing 1 package: gtable
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/gtable_0.2.0.zip'
Content type 'application/zip' length 57807 bytes (56 KB)
downloaded 56 KB
package ‘gtable’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\rmf\AppData\Local\Temp\Rtmp8Eaf5a\downloaded_packages
Installing 1 package: tidyr
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/tidyr_0.6.1.zip'
Content type 'application/zip' length 860798 bytes (840 KB)
downloaded 840 KB
package ‘tidyr’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\rmf\AppData\Local\Temp\Rtmp8Eaf5a\downloaded_packages
"C:/R/R-33~1.3/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL \
"C:/Users/rmf/AppData/Local/Temp/Rtmp8Eaf5a/devtools2fe8287648ea/royfrancis-test-4d3547f" --library="C:/R/R-3.3.3/library" \
--install-tests
* installing *source* package 'x' ...
** R
** inst
** tests
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called 'scales'
Error : package 'ggplot2' could not be loaded
ERROR: lazy loading failed for package 'x'
* removing 'C:/R/R-3.3.3/library/x'
Error: Command failed (1)
Session info
R version 3.3.3 (2017-03-06)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_1.12.0
loaded via a namespace (and not attached):
[1] httr_1.2.1 R6_2.2.0 tools_3.3.3 withr_1.0.2 curl_2.5 memoise_1.0.0
[7] git2r_0.18.0 digest_0.6.12
Related
I am trying to install ggplot2, which I had previously had installed however, I keep on getting an error message saying
ggplot2 had non-zero exit status.
I have updated R, unistalled and reinstalled it.
I have also done "install.packaged("ggplot2", dependencies = TRUE), that did not work, I have tried to install each dependency independently, which did not work.
I have tried to update some of the dependencies, especially rlang, however, the version nevers changes, so again had no success...
This is the error message
>install.packages("ggplot2", dependencies = TRUE)
Installing package into ‘C:/Users/Liah Brown/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘rlang’
There are binary versions available but the source versions are
later:
binary source needs_compilation
rlang 0.2.0 0.3.1 TRUE
ggplot2 2.2.1 3.1.0 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/rlang_0.2.0.zip'
Content type 'application/zip' length 754726 bytes (737 KB)
downloaded 737 KB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Liah Brown\AppData\Local\Temp\Rtmpao258F\downloaded_packages
installing the source package ‘ggplot2’
trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.1.0.tar.gz'
Content type 'application/x-gzip' length 2863109 bytes (2.7 MB)
downloaded 2.7 MB
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'rlang' 0.2.0 is being loaded, but >= 0.2.1 is required
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/Liah Brown/Documents/R/win-library/3.3/ggplot2'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Liah Brown\Documents\R\win-library\3.3" C:\Users\LIAHBR~1\AppData\Local\Temp\Rtmpao258F/downloaded_packages/ggplot2_3.1.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Liah Brown\AppData\Local\Temp\Rtmpao258F\downloaded_packages’
My session info is...
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] plyr_1.8.4
loaded via a namespace (and not attached):
[1] tools_3.3.2 yaml_2.1.18 Rcpp_0.12.16
And this is my .libPaths()
[1] "C:/Users/Liah Brown/Documents/R/win-library/3.3"
[2] "C:/Program Files/R/R-3.3.2/library"
I've been having quite a time installing XML on a shiny server. It is currently installed, but I can't quite install it on a separate user, shiny or using sudo.
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
ERROR: 'configure' exists but is not executable -- see the 'R Installation
and Administration Manual'
* removing ‘/home/dalgleishjl/R/x86_64-redhat-linux-gnu-library/3.5/XML’
* restoring previous ‘/home/dalgleishjl/R/x86_64-redhat-linux-gnu-
library/3.5/XML’
The downloaded source packages are in
‘/tmp/RtmpMK29rO/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
attempting it with sudo R has the following result:
trying URL 'https://cloud.r-project.org/src/contrib/XML_3.98-1.11.tar.gz'
Content type 'application/x-gzip' length 1599533 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
* installing *source* package ‘XML’ ...
** package ‘XML’ successfully unpacked and MD5 sums checked
ERROR: 'configure' exists but is not executable -- see the 'R Installation
and Administration Manual'
* removing ‘/usr/lib64/R/library/XML’
The downloaded source packages are in
‘/tmp/RtmpJCIVd4/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
I've tried it on the user shiny (sudo -u shiny R):
trying URL 'https://cloud.r-project.org/src/contrib/XML_3.98-1.11.tar.gz'
Content type 'application/x-gzip' length 1599533 bytes (1.5 MB)
==================================================
downloaded 1.5 MB
Error in setwd(od) : cannot change working directory
Error in setwd(startdir) : cannot change working directory
Execution halted
The downloaded source packages are in
‘/tmp/Rtmpa7IPyB/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package ‘XML’ had non-zero exit status
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.0 tools_3.5.0
I've also installed the most recent version of libxml2-devel and libxml2
(using sudo yum install libxml2-devel and sudo yum install libxml2).
It's actually fairly straightforward. Using sudo R to start R, do the following:
dir.create("/home/username/tmp/")
Sys.setenv(TMPDIR="/home/username/tmp/")
install.packages(“XML”)
Been trying to install googleway for more than a week and it is just not working.
i have used the: install.packages("googleway", dependencies= T)'
install.packages("googleway",
repos=c("http://rstudio.org/_packages",
"http://cran.rstudio.com"))
i see it in my package list but when i try to call it with library it gives an error that another package is missing. the packages are : mime jsonlite Rcpp
tried installing these separately but still..
sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.2 tools_3.4.2
trying to install today was successful, library() command gave the below
library(googleway)
Error: package or namespace load failed for ‘googleway’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘shiny’
going back to the installation code:
package ‘shiny’ successfully unpacked and MD5 sums checked
tried to seperately installing 'shiny', got the below error message when installation finished:
Error: invalid version specification ‘NA’
In addition: Warning message:
In utils:::packageDescription(packageName, fields = "Version") :
no package 'knitr' was found
tried to call googleway after that:
library(googleway)
Error: package or namespace load failed for ‘googleway’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘htmltools’
i did try to install knitr still i get that a certain package is missing when i call googleway
note that i am able to download other packages and calling them successfully.
The problem was not with googleway as other packages started doing the same.
I uninstalled and reinstalled R and Rstudio then i reset R studio to desktop state using this link
https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-s-State
I tried to install the package ggplot2 on my computer with the command line:
install.packages("C:/r-packages/ggplot2",repos = NULL,type = "sourse")
Unfortunately I got the following error:
* installing *source* package 'ggplot2' ...
** package 'ggplot2' successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
object 'vI' not found
ERROR: lazy loading failed for package 'ggplot2'
* removing 'C:/Users/rachel/Documents/R/win-library/3.3/ggplot2'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l
"C:\Users\rachel\Documents\R\win-library\3.3" "C:/r-packages/ggplot2"' had status 1
Warning in install.packages :
installation of package ‘C:/r-packages/ggplot2’ had non-zero exit status
I don't have a connection to the internet so I can't download the package directly (This is why the repos=NULL). I also installed Rtools, but I still face the same problem. The same error appears when I am trying to install the packages car or devtools
sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server >= 2012 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] Rcpp_0.12.6
loaded via a namespace (and not attached):
[1] tools_3.3.1
You don't need to unzip the source file that you download from CRAN (make sure it is the source, too: you want the one labelled 'Package source'). So if you're installing from source and have downloaded to your typical Downloads folder, I'd expect it to look like this:
install.packages("C:/Users/rachel/Downloads/ggplot2_2.1.0.tar.gz")
(The repos argument is inferred if you're only installing one package at a time, and type defaults to source. You misspelt source in your example, but I don't think that's a problem because of the default.)
You could also download the Windows binary, which comes as a ZIP file, and install that in a similar way:
install.packages("C:/Users/rachel/Downloads/ggplot2_2.1.0.zip", type = 'win.binary')
I'm having trouble loading ggplot2 using R version 2.12.1, as shown below. The only help I can find suggests loading "proto". I tried that and it didn't fix my problem. Any help would be very much appreciated. Thanks,
peter l
> install.packages('ggplot2', dep = TRUE)
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/leopard/contrib/2.12/ggplot2_0.8.9.tgz'
Content type 'application/x-gzip' length 2481399 bytes (2.4 Mb)
opened URL
=================================================
downloaded 2.4 Mb
The downloaded packages are in
/var/folders/XF/XF0tU7gdGTeF4Th7KhKYDk+++TI/-Tmp-//RtmpFMnqLB/downloaded_packages
> library(ggplot2)
Error in assign(names[i], dots[[i]], env = envir) :
invalid first argument
Error : unable to load R code in package 'ggplot2'
Error: package/namespace load failed for 'ggplot2'
Hmmm, have you omitted some lines there, before the The downloaded packages are in....? I get:
> install.packages('ggplot2', dep = TRUE)
Installing package(s) into ‘/home/gavin/R/libs’
(as ‘lib’ is unspecified)
trying URL 'http://cran.uk.r-project.org/src/contrib/ggplot2_0.8.9.tar.gz'
Content type 'application/x-gzip' length 2074749 bytes (2.0 Mb)
o pened URL
==================================================
downloaded 2.0 Mb
* installing *source* package ‘ggplot2’ ...
** R
** data
** moving datasets to lazyload DB
** inst
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
* DONE (ggplot2)
The downloaded packages are in
‘/tmp/RtmpfDSoM8/downloaded_packages’
> require(ggplot2)
Loading required package: ggplot2
Loading required package: reshape
Loading required package: plyr
Attaching package: 'reshape'
The following object(s) are masked from 'package:plyr':
round_any
Loading required package: grid
Loading required package: proto
Do you also see the * Done (ggplot2) message for example? If not, the installation likely failed for some reason and we need more details in order to help.
The above was on
> sessionInfo()
R version 2.12.1 Patched (2011-02-06 r54249)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=C LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets
[7] methods base
other attached packages:
[1] ggplot2_0.8.9 proto_0.3-8 reshape_0.8.4 plyr_1.4
loaded via a namespace (and not attached):
[1] tools_2.12.1