Unable to install package Rcpp successfully in R Studio - r

I am unable to install the package "rcpp" in R Studio even though it was executed successfully. When I try to load the sasme library, it doesnt show me in the list of installed libraries.
install.packages("Rcpp")
Installing package into ‘C:/Users/sk/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/Rcpp_1.0.4.6.zip'
Content type 'application/zip' length 3030990 bytes (2.9 MB)
downloaded 2.9 MB
package ‘Rcpp’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘Rcpp’
library(Rcpp)
Error in library(Rcpp) : there is no package called ‘Rcpp’

I was able to install by downloading the .tar.gz file from the archive link:
https://cran.r-project.org/src/contrib/Archive/Rcpp/
and installing this instead of directly from CRAN.
I had to install a few other libraries which were dependent on this library as well.

Related

Unable to install any package in computer at my office, how to fix?

I'm trying to use computer in my office for working using Rstudio because I realised that there is Rstudio installed in the computer. However, when I'm trying to install the package I need, the package is unable to install. I try so many package but the same issue happen.Even though, I'm trying to update installed package such as rlang version 1.02 to the latest one, it is also failed. I've tried to restart Rstudio as well after I installed the package, but I can't find the package that I have installed before.
Here is the error message that I receive when I try to install the very standard one such as scales package:
install.packages("scales")
also installing the dependencies ‘rlang’, ‘lifecycle’
There are binary versions available but the source versions are later:
binary source needs_compilation
rlang 1.0.2 1.0.6 TRUE
lifecycle 1.0.1 1.0.2 FALSE
scales 1.2.0 1.2.1 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/rlang_1.0.2.zip'
Content type 'application/zip' length 1718546 bytes (1.6 MB)
downloaded 1.6 MB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\axk1076\AppData\Local\Temp\RtmpYjc7m3\downloaded_packages
installing the source packages ‘lifecycle’, ‘scales’
trying URL 'https://cran.rstudio.com/src/contrib/lifecycle_1.0.2.tar.gz'
Content type 'application/x-gzip' length 102178 bytes (99 KB)
downloaded 99 KB
trying URL 'https://cran.rstudio.com/src/contrib/scales_1.2.1.tar.gz'
Content type 'application/x-gzip' length 270609 bytes (264 KB)
downloaded 264 KB
'\\adf\storage\A\K\AXK1076'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'lifecycle' ...
** package 'lifecycle' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'rlang' 1.0.2 is being loaded, but >= 1.0.5 is required
Calls: <Anonymous> ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package 'lifecycle'
* removing 'C:/Program Files/R/R-4.0.3/library/lifecycle'
Warning in install.packages :
installation of package ‘lifecycle’ had non-zero exit status
'\\adf\storage\A\K\AXK1076'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
ERROR: dependency 'lifecycle' is not available for package 'scales'
* removing 'C:/Program Files/R/R-4.0.3/library/scales'
Warning in install.packages :
installation of package ‘scales’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\axk1076\AppData\Local\Temp\RtmpYjc7m3\downloaded_packages’
I don't know how Rstudio installed in this computer and I'm truly beginner in R. Is there anyone can help me? thank you in advance. Regards.
Since it is not known how R was installed in your computer, I would highly recommend you to uninstall both R and RStudio and installing the latest versions from the official websites.
First install R from: https://cran.r-project.org/bin/windows/base/
Install RStudio from: https://www.rstudio.com/products/rstudio/download/
Maybe they were installed in the wrong settings for your computer. Also to prevent bigger issues in the future (especially for beginners), that's the best option.

Bioconductor installation difficulty

recently I've changed a computer into a new one and suddenly I cannot install Bioconductor. I used this code, and this is what I get:
source("https://bioconductor.org/biocLite.R")
Installing package into ‘\\uniwa.uwa.edu.au/userhome/students8/21891458/My Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://bioconductor.org/packages/3.7/bioc/bin/windows/contrib/3.5/BiocInstaller_1.30.0.zip'
Content type 'application/zip' length 102191 bytes (99 KB)
downloaded 99 KB
package ‘BiocInstaller’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘BiocInstaller’
The downloaded binary packages are in
C:\Users\21891458\AppData\Local\Temp\Rtmp2DZpRQ\downloaded_packages
'biocLite.R' failed to install 'BiocInstaller', use 'install.packages("BiocInstaller",
repos="https://bioconductor.org/packages/3.7/bioc")' or 'install.packages("BiocInstaller",
repos="http://bioconductor.org/packages/3.7/bioc")'
The problem is it doesn't install it. I tried removing Bioconductor, I tried removing BiocInstaller and I tried even reinstalling Rstudio. None of this helped. What am I doing wrong?

Unable to install sandwich package: installation of package ‘sandwich’ had non-zero exit status

I need to install the "plm" package. After installing it, the "sandwich" package was missing.
> library(plm)
Error: package or namespace load failed for ‘plm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘sandwich
Tried to install the "sandwich" package, returned with this:
Installing package into ‘library_path’
(as ‘lib’ is unspecified)
also installing the dependency ‘zoo’
There is a binary version available but the source version is later:
binary source needs_compilation
sandwich 2.3-4 2.4-0 FALSE
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/zoo_1.8-0.zip'
Content type 'application/zip' length 901864 bytes (880 KB)
downloaded 880 KB
package ‘zoo’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\directory\downloaded_packages
installing the source package ‘sandwich’
trying URL 'https://cran.rstudio.com/src/contrib/sandwich_2.4-0.tar.gz'
Content type 'application/x-gzip' length 1280592 bytes (1.2 MB)
downloaded 1.2 MB
'\\directory\My Documents'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
* installing *source* package 'sandwich' ...
** package 'sandwich' successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
Warning in file(con, "w") :
cannot open file '\\library_path/sandwich/doc/index.html': No such file or directory
Error in file(con, "w") : cannot open the connection
ERROR: installing vignettes failed
* removing '\\library_path/sandwich'
Warning in install.packages :
running command '"C:/R-34~1.1/bin/x64/R" CMD INSTALL -l "\\library_path" C:\directory/downloaded_packages/sandwich_2.4-0.tar.gz' had status 1
Warning in install.packages :
installation of package ‘sandwich’ had non-zero exit status
The downloaded source packages are in
‘C:\directory\downloaded_packages’
Had tried:
Reinstall R and RStudio directly to C (not in C:\Program Files)
Using this command to install all the dependencies:
install.packages("sandwich", dependencies=TRUE)
Still, the "non-zero exit status" appeared. Do you have any suggestions?
I am using Windows 7 (64 bit), R 3.4.1 and RStudio 1.0.153
I think i found a temporary answer for my problem. I previously had problems related to the privilege in writing the library folder in R. Tried to work around by turning off anti-virus live update, change the security of the R folder, etc. I thought it was worked, since I did not find anymore issues on "unable to move temporary installation....". But when I restart my computer, the problem came again.
Since I am working in a university provided laptop, I need to wait until the IT grants me access as an admin. While waiting for it, I created a new library in C:/ (in my case, I named it as "R library local"). Downloaded all the package to that library
install.packages("plm", dependencies = TRUE, lib = "C:/R library local")
And load the package from the library
library("plm", lib="C:/R library local")
It works well :)
Dunno if I still need the admin access for the library in R folder or not.

Persistent problems installing the car package in R

I'm having problems installing the package car in R.
There are previous posts on the topic, including this one and this other one.
I have followed the suggestions I've come across so far without success. I am using R Version 3.2.2. and RStudio.
This is the message I get:
install.packages("car")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/car_2.1-3.zip'
Content type 'application/zip' length 1447213 bytes (1.4 MB)
downloaded 1.4 MB
package ‘car’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
If I check I get,
?car
No documentation for ‘car’ in specified packages and libraries:
you could try ‘??car’
I tried installing it from R with Install packages from local zip drives, and looking for the zip in C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages, but this is the result:
library(car)
Error in library.dynam(lib, package, package.lib) :
DLL ‘SparseM’ not found: maybe not installed for this architecture?
In addition: Warning message:
package ‘car’ was built under R version 3.2.5
Error: package or namespace load failed for ‘car’
I did try installing SparseM even before posting the OP without success:
> install.packages("SparseM")
Installing package into ‘C:/Users/.../Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/SparseM_1.7.zip'
Content type 'application/zip' length 795531 bytes (776 KB)
downloaded 776 KB
package ‘SparseM’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\...\AppData\Local\Temp\Rtmpc3xr5i\downloaded_packages
> ?SparseM
No documentation for ‘SparseM’ in specified packages and libraries:
you could try ‘??SparseM’
Follow up:
After a comment regarding R version 3.2.3 I thought it would be an easy fix to just download this version, install, and erase 3.2.2. The problem then is that RStudio did not seem to work. I un-installed and re-installed R-studio, and now I get this when opening R studio:
Without knowing what version of the car package you're using, it's hard to know exactly what the source of the problem is. It seems likely, however, that you haven't installed the proper version of the pbkrtest, on which the Rcmdr package depends.
Is there a compelling reason not to upgrade everything to their current versions, including R, all packages, and RStudio?
Best,
John

Devtools/library download error

I am trying to install Devtools into Rstudio. I was using Rgui, but decided to use Rstudio becuase it seems to be easier. I able to get DevTools on Rgui, but not RStudio.
Basicly. the library on Rstudio does not have DEVtools installed and I am having problems. Any ideas?
I tried the install.packages("devtools") states it is install in y computer, but does not show in the library. I tried GitHub. did not wok either.
install.packages("devtools")
Installing package into ‘C:/Users/Steven/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
trying
URL 'https://cran.rstudio.com/bin/windows/contrib/3.2/devtools_1.10.0.zip'
Content type 'application/zip' length 391482 bytes (382 KB)
downloaded 382 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot remove prior installation of package ‘devtools’
The downloaded binary packages are in
C:\Users\Steven\AppData\Local\Temp\RtmpkxtbPl\downloaded_packages
However, I do Library(devtools) states Error in library(devtools) : there is no package called ‘devtool

Resources