R/ R Studio install.packages('tidyverse') epic installation - r

I'm trying to install this package on a brand new setup of my Laptop W10/64, downloaded brand new RStudio 1.1.419 (as of today 1/28/2018), didn't do anything to profiles.
After running install.packages('tidyverse') I see a lot of dependencies errors like below, how to take care of them in one shot ? I assume should be some dependencies helper in install? Or there is other way to download 1G of R packages to have them all? Or should I have take of these missing brooms one by one? I did my home work and see so many thing about installation problems, assume this is OK for free version.
Warning in install.packages :
installation of package ‘callr’ had non-zero exit status
ERROR: dependencies 'rlang', 'utf8' are not available for package 'pillar'
* removing 'C:/Users/Lap10/Documents/R/win-library/3.2/pillar'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Lap10\Documents\R\win-library\3.2" C:\Users\Lap10\AppData\Local\Temp\Rtmp8g3UW7/downloaded_packages/pillar_1.1.0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘pillar’ had non-zero exit status
ERROR: dependencies 'rlang', 'tidyselect' are not available for package 'dbplyr'
* removing 'C:/Users/Lap10/Documents/R/win-library/3.2/dbplyr'
Warning in install.packages :
After going on missing packages I have this:
install.packages('rlang')
Installing package into ‘C:/Users/Lap10/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘rlang’
These will not be installed
library(rlang)
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/Lap10/Documents/R/win-library/3.2/rlang/libs/x64/rlang.dll':
LoadLibrary failure: The specified procedure could not be found.
session info:
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] dplyr_0.5.0
loaded via a namespace (and not attached):
[1] magrittr_1.5 R6_2.2.2 assertthat_0.2.0 DBI_0.7 tools_3.2.2 tibble_1.3.0
[7] Rcpp_0.12.10
>

Related

How to solve this R package tidyverse error

Good afternoon!
Under R i get this error while trying to load tidyverse
library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
namespace ‘rlang’ 0.4.7 is already loaded, but >= 0.4.10 is required
Session info :
sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
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] intervals_0.15.2
loaded via a namespace (and not attached):
[1] compiler_4.0.0 R6_2.5.0 rsconnect_0.8.16 generics_0.1.0 tools_4.0.0 glue_1.4.0
[7] tinytex_0.25 vctrs_0.3.2 xfun_0.13 rlang_0.4.7
Error while trying to update rlang (solved ):
remotes::install_github("r-lib/rlang")
Downloading GitHub repo r-lib/rlang#HEAD
Running `R CMD build`...
* checking for file 'C:\Users\Mouad\AppData\Local\Temp\RtmpgjncCL\remotes29b8390c1ebf\r-lib-rlang-98515e9/DESCRIPTION' ... OK
* preparing 'rlang':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to process help pages
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building 'rlang_0.4.10.9000.tar.gz'
Installing package into ‘C:/Users/Mouad/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
* installing *source* package 'rlang' ...
ERROR: cannot remove earlier installation, is it in use?
* removing 'C:/Users/Mouad/Documents/R/win-library/4.0/rlang'
* restoring previous 'C:/Users/Mouad/Documents/R/win-library/4.0/rlang'
Error in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
(converted from warning) problem copying C:\Users\Mouad\Documents\R\win-library\4.0\00LOCK-rlang\rlang\libs\x64\rlang.dll to C:\Users\Mouad\Documents\R\win-library\4.0\rlang\libs\x64\rlang.dll: Permission denied
* removing 'C:/Users/Mouad/Documents/R/win-library/4.0/rlang'
* restoring previous 'C:/Users/Mouad/Documents/R/win-library/4.0/rlang'
Error in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
(converted from warning) problem copying C:\Users\Mouad\Documents\R\win-library\4.0\00LOCK-rlang\rlang\libs\x64\rlang.dll to C:\Users\Mouad\Documents\R\win-library\4.0\rlang\libs\x64\rlang.dll: Permission denied
Execution halted
Error: Failed to install 'rlang' from GitHub:
(converted from warning) installation of package ‘C:/Users/Mouad/AppData/Local/Temp/RtmpgjncCL/file29b84c897087/rlang_0.4.10.9000.tar.gz’ had non-zero exit status
Loading of tidyverse !
library('tidyverse')
Error: package or namespace load failed for ‘tidyverse’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Users/Mouad/Documents/R/win-library/4.0/Rcpp/libs/x64/Rcpp.dll':
LoadLibrary failure: The specified procedure could not be found.
In addition: Warning message:
package ‘tidyverse’ was built under R version 4.0.3
Thank you a lot for help!

Installation of pkgconfig on Windows

I have successfully installed and loaded readxl package. When I am trying to use the function readxl::read_xlsx(), it throws and error that R cannot find pkgconfig.
I have tried to install this package, but it throws another error, which is presented below:
Installing package into ‘C:/Users/Maintenant Prêt!/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
pkgconfig 2.0.2 2.0.3 FALSE
installing the source package ‘pkgconfig’
trying URL 'https://cran.rstudio.com/src/contrib/pkgconfig_2.0.3.tar.gz'
Content type 'application/x-gzip' length 6080 bytes
downloaded 6080 bytes
* installing *source* package 'pkgconfig' ...
** package 'pkgconfig' successfully unpacked and MD5 sums checked
** using staged installation
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Maintenant Prjt!/Documents/R/win-library/3.6/00LOCK-pkgconfig/00new/pkgconfig/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'pkgconfig'
* removing 'C:/Users/Maintenant Prêt!/Documents/R/win-library/3.6/pkgconfig'
Warning in install.packages :
installation of package ‘pkgconfig’ had non-zero exit status
I have checked and there are no hidden 00LOCK folders in packages folder, which can conflict with installation. My three suggestions are: (1) either there are no writing rights to this folder (which is wired since all packages are installed normally), (2) or a special symbol ê in the name of the parent folder creates problems.
Does anyone know a workaround?
Here are results of the sessionInfo() and .libPaths():
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] 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] readxl_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 crayon_1.3.4 assertthat_0.2.1 cellranger_1.1.0
[5] R6_2.4.0 magrittr_1.5 pillar_1.4.2 rlang_0.4.0
[9] rstudioapi_0.10 tools_3.6.1 glue_1.3.1 compiler_3.6.1
and
[1] "C:/Users/Maintenant Prêt!/Documents/R/win-library/3.6"
[2] "C:/Program Files/R/R-3.6.1/library"

Installing ggplot2 in R without being connected to the Internet

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')

Cannot get to install ggplot2 from within RStudio or R console

I'm running R v3.2.0 with RStudio as well. The machine I'm running on has no internet access and therefore I'm having to download and install packages locally. I am trying to install ggplot2 which requires lots of dependecies (with their own dependencies) to be downloaded and installed. I have arrived at the point where most of them have been installed. However, I still get the following when I try:
> install.packages("~/R_packages/ggplot2_2.0.0.tar.gz", repos = NULL, type = "source")
Installing package into ‘/u01/app/oracle/product/12.1.0.2/dbhome_1/R/library’
(as ‘lib’ is unspecified)
* 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
No protocol specified
Warning in fun(libname, pkgname) : couldn't connect to display ":0"
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/u01/app/oracle/product/12.1.0.2/dbhome_1/R/library/scales/libs/scales.so':
/u01/app/oracle/product/12.1.0.2/dbhome_1/R/library/scales/libs/scales.so: invalid ELF header
ERROR: lazy loading failed for package ‘ggplot2’
* removing ‘/u01/app/oracle/product/12.1.0.2/dbhome_1/R/library/ggplot2’
Warning in install.packages :
installation of package ‘/home/oracle/R_packages/ggplot2_2.0.0.tar.gz’ had non-zero exit status
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
Has anyone got any ideas why this is happening?
Edit:
Oracle Distribution of R version 3.2.0 (--)
Platform: x86_64-unknown-linux-gnu (64-bit)
Running under: Oracle Linux Server 6.7
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=en_US.UTF-8 LC_ADDRESS=en_US.UTF-8
[10] LC_TELEPHONE=en_US.UTF-8 LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_0.4.2 stringi_0.4-1 nnet_7.3-9 randomForest_4.6-10 ROracle_1.2-1
[6] DBI_0.3.1 rpart_4.1-9 ORCH_2.5.1 ORCHstats_2.5.1 ORCHcore_2.5.1
[11] rJava_0.9-7 OREstats_1.5 MASS_7.3-40 OREbase_1.5 OREcommon_1.5
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 png_0.1-7 assertthat_0.1 R6_2.0.1 grid_3.2.0 OREembed_1.5 magrittr_1.5
[8] tools_3.2.0 parallel_3.2.0
Edit 2:
library(ggplot2)
No protocol specified
Attaching package: ‘ggplot2’
The following object is masked from ‘package:randomForest’:
margin
Warning message:
In fun(libname, pkgname) : couldn't connect to display ":0"

Issue installing package 'quantmod'

I keep having this error when I try to install quantmod package from the CRAN repository:
install.packages("quantmod")
Installing package into ‘C:/Users/Dominic/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘xts’, ‘zoo’, ‘TTR’
Packages which are only available in source form, and may need compilation of
C/C++/Fortran: ‘xts’ ‘zoo’ ‘TTR’ ‘quantmod’
These will not be installed
I also downloaded the .gz files locally and install but get the following error:
Installing package into ‘C:/Users/Dominic/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
ERROR: dependencies 'xts', 'zoo', 'TTR' are not available for package 'quantmod'
* removing 'C:/Users/Dominic/Documents/R/win-library/3.2/quantmod'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-32~1.2/bin/x64/R" CMD INSTALL -l "C:\Users\Dominic\Documents\R\win-library\3.2" "C:/Users/Dominic/AppData/Local/Temp/RtmpMnw2yn/downloaded_packages/quantmod_0.4-5.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘C:/Users/Dominic/AppData/Local/Temp/RtmpMnw2yn/downloaded_packages/quantmod_0.4-5.tar.gz’ had non-zero exit status
Here is the output of sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8 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
loaded via a namespace (and not attached):
[1] tools_3.2.2
1- Download the latest version from:
https://cran.r-project.org/bin/windows/contrib/3.4/quantmod_0.4-8.zip
2- unzip it in your package directory. It can be found with:
.libPaths()
3- Make sure the folder name reads "quantmod" in your package directory.
4- Type in library("quantmod")

Resources