install.packages() having issues with setwd() - r

I'm attempting to install a package in R (v3.4 on Linux (64-bit)) and am being told that the execution was halted.
I attempted to log out of R and clear out my History and Environment. Below is the cod and the output I am getting:
> install.packages('zip')
Installing package into ‘/home/clang/R/x86_64-redhat-linux-gnu-library/3.4’ (as ‘lib’ is
unspecified) trying URL
'http://cran.rstudio.com/src/contrib/zip_1.0.0.tar.gz' Content type
'application/x-gzip' length 60823 bytes (59 KB)
================================================== downloaded 59 KB
Error: 1:7: unexpected '/' 1: setwd(/
^ Execution halted Warning in install.packages : installation of package ‘zip’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpaFlNP9/downloaded_packages’

Related

I can't install any package because of beepr package error

I keep getting this error whenever I open rstudio.
Error in library(beepr) : there is no package called ‘beepr’
Even, when I tried installing the package itself, I get the same error!
Not just this, I was trying to install other packages on R and I couldn't because of the same error!
Edit:
I tried installing beepr package
install.packages("beepr")
and it gave that error
also installing the dependencies ‘glue’, ‘magrittr’, ‘stringi’, ‘stringr’, ‘audio’
trying URL 'https://cran.rstudio.com/src/contrib/glue_1.4.2.tar.gz'
Content type 'application/x-gzip' length 99049 bytes (96 KB)
==================================================
downloaded 96 KB
trying URL 'https://cran.rstudio.com/src/contrib/magrittr_2.0.1.tar.gz'
Content type 'application/x-gzip' length 265580 bytes (259 KB)
==================================================
downloaded 259 KB
trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.7.4.tar.gz'
Content type 'application/x-gzip' length 7599762 bytes (7.2 MB)
==================================================
downloaded 7.2 MB
trying URL 'https://cran.rstudio.com/src/contrib/stringr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 135777 bytes (132 KB)
==================================================
downloaded 132 KB
trying URL 'https://cran.rstudio.com/src/contrib/audio_0.1-8.tar.gz'
Content type 'application/x-gzip' length 57390 bytes (56 KB)
==================================================
downloaded 56 KB
trying URL 'https://cran.rstudio.com/src/contrib/beepr_1.3.tar.gz'
Content type 'application/x-gzip' length 922244 bytes (900 KB)
==================================================
downloaded 900 KB
Error in library(beepr) : there is no package called ‘beepr’
Execution halted
Warning in install.packages :
installation of package ‘glue’ had non-zero exit status
Error in library(beepr) : there is no package called ‘beepr’
Execution halted
Warning in install.packages :
installation of package ‘magrittr’ had non-zero exit status
Error in library(beepr) : there is no package called ‘beepr’
Execution halted
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
Error in library(beepr) : there is no package called ‘beepr’
Execution halted
Warning in install.packages :
installation of package ‘audio’ had non-zero exit status
Error in library(beepr) : there is no package called ‘beepr’
Execution halted
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
Error in library(beepr) : there is no package called ‘beepr’
Execution halted
Warning in install.packages :
installation of package ‘beepr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp0CeBTl/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning in install.packages :
converting NULL pointer to R NULL
Warning message:
R graphics engine version 14 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.

R doesn't work properly with conda installation

I tried installing r with conda and every time I try that it doesn't work.
conda create --name test2 -c conda-forge r-base r-seurat
I assumed that by using conda-forge channel, it will install the most updated version. What happened is that it installs the oldest version of R which is 3.6.1
At the same time, the "Seurat" package requires a newer version of R than 3.6.1
So, I specified a version of R in that code and it didn't work too
conda create --name test2 -c conda-forge r-base=4.1.1
This worked for installing a newer R version but when I try activating R on that environment, it gives me an error
Error in library(beepr) : there is no package called ‘beepr’
So, I opened rstudio from that environment and tried installing (beepr) package and it didn't work! It tries to install other packages as a requirement for it and at the same time gives the same error of not having "beepr" installed.
That's one of the packages it tried to install.
Warning in install.packages : installation of package ‘glue’ had non-zero exit status Error in library(beepr) : there is no package called ‘beepr’ Execution halted
and it does that with the rest of packages required.
That's the error I get from installing beepr
also installing the dependencies ‘glue’, ‘magrittr’, ‘stringi’, ‘stringr’, ‘audio’ trying URL 'https://cran.rstudio.com/src/contrib/glue_1.4.2.tar.gz' Content type 'application/x-gzip' length 99049 bytes (96 KB) ================================================== downloaded 96 KB trying URL 'https://cran.rstudio.com/src/contrib/magrittr_2.0.1.tar.gz' Content type 'application/x-gzip' length 265580 bytes (259 KB) ================================================== downloaded 259 KB trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.7.4.tar.gz' Content type 'application/x-gzip' length 7599762 bytes (7.2 MB) ================================================== downloaded 7.2 MB trying URL 'https://cran.rstudio.com/src/contrib/stringr_1.4.0.tar.gz' Content type 'application/x-gzip' length 135777 bytes (132 KB) ================================================== downloaded 132 KB trying URL 'https://cran.rstudio.com/src/contrib/audio_0.1-8.tar.gz' Content type 'application/x-gzip' length 57390 bytes (56 KB) ================================================== downloaded 56 KB trying URL 'https://cran.rstudio.com/src/contrib/beepr_1.3.tar.gz' Content type 'application/x-gzip' length 922244 bytes (900 KB) ================================================== downloaded 900 KB Error in library(beepr) : there is no package called ‘beepr’ Execution halted Warning in install.packages : installation of package ‘glue’ had non-zero exit status Error in library(beepr) : there is no package called ‘beepr’ Execution halted Warning in install.packages : installation of package ‘magrittr’ had non-zero exit status Error in library(beepr) : there is no package called ‘beepr’ Execution halted Warning in install.packages : installation of package ‘stringi’ had non-zero exit status Error in library(beepr) : there is no package called ‘beepr’ Execution halted Warning in install.packages : installation of package ‘audio’ had non-zero exit status Error in library(beepr) : there is no package called ‘beepr’ Execution halted Warning in install.packages : installation of package ‘stringr’ had non-zero exit status Error in library(beepr) : there is no package called ‘beepr’ Execution halted Warning in install.packages : installation of package ‘beepr’ had non-zero exit status The downloaded source packages are in ‘/tmp/Rtmp0CeBTl/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Warning in install.packages : converting NULL pointer to R NULL Warning message: R graphics engine version 14 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
Did anyone face that issue before?

Having problems installing.packag("BatchGetSymbols")

I can't install.package("BatchGetSymbols") for some reason.
I am just doing this:
install.packages('BatchGetSymbols')
library(BatchGetSymbols)
and i am getting this:
> install.packages('BatchGetSymbols')
Installing package into ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘XML’ is not available
trying URL 'https://cran.rstudio.com/src/contrib/BatchGetSymbols_2.5.7.tar.gz'
Content type 'application/x-gzip' length 181321 bytes (177 KB)
==================================================
downloaded 177 KB
ERROR: dependency ‘XML’ is not available for package ‘BatchGetSymbols’
* removing ‘/home/rstudio/R/x86_64-pc-linux-gnu-library/3.6/BatchGetSymbols’
Warning in install.packages :
installation of package ‘BatchGetSymbols’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpAhaAos/downloaded_packages’
> library(BatchGetSymbols)
Error in library(BatchGetSymbols) :
there is no package called ‘BatchGetSymbols’
Does anyone understand why there is a problem??
Install the latest version of R before
Commands to install: https://cloud.r-project.org/bin/linux/
Choose the version of your system and run the commands
After that try to install the library.

Unable to install the car package in R Studio in Windows 10

I'm running RStudio v1.2.5019.
The User folder on my laptop where the packages are stored is C:\Users\R Shiva
I am trying to install packages including car but I'm getting the following error.
Installing package into ‘C:/Users/R Shiva/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
also installing the dependency ‘carData’
There are binary versions available but the source versions are later:
binary source needs_compilation
carData 3.0-2 3.0-3 FALSE
car 3.0-4 3.0-5 FALSE
installing the source packages ‘carData’, ‘car’
trying URL 'https://cran.rstudio.com/src/contrib/carData_3.0-3.tar.gz'
Content type 'application/x-gzip' length 995544 bytes (972 KB)
downloaded 972 KB
trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-5.tar.gz'
Content type 'application/x-gzip' length 504300 bytes (492 KB)
downloaded 492 KB
Warning: invalid package 'C:\Users\R'
Warning: invalid package 'Shiva\AppData\Local\Temp\RtmpU7R8OM/downloaded_packages/carData_3.0-3.tar.gz'
Error: ERROR: no packages specified
Warning in install.packages :
installation of package ‘carData’ had non-zero exit status
Warning: invalid package 'C:\Users\R'
Warning: invalid package 'Shiva\AppData\Local\Temp\RtmpU7R8OM/downloaded_packages/car_3.0-5.tar.gz'
Error: ERROR: no packages specified
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\R Shiva\AppData\Local\Temp\RtmpU7R8OM\downloaded_packages’

install.package() on RStudio on Amazon EC2 doesn't work. Package not available for R version 3.3.3

I've seen this: How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning?
and been through the list. No luck. I've also navigated via SSH to my library to see if there was some LOCK file or corrupt install. There is nothing there.
I literally just installed RStudio on Amazon EC2 and can't install the any new packages.
I've done it this way: https://aws.amazon.com/blogs/big-data/running-r-on-aws/
I've also used Ubuntu with Louis Anslett's AMI: http://www.louisaslett.com/RStudio_AMI/
I get the same problem in both. I have downloaded them manually and installed the tar.gz files from the temp directory. The CRAN repository seems to be fine because install.packages() downloads the tar.gz to /tmp/Rtmp2Rh9Zr/downloaded_packages/ just fine, but then the actual install process fails.
When I run install.packages("haven") for instance, it says
> install.packages("haven")
Installing package into ‘/home/jblocher/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependencies ‘R6’, ‘assertthat’, ‘rlang’, ‘Rcpp’, ‘readr’, ‘hms’, ‘tibble’, ‘BH’
trying URL 'https://cran.rstudio.com/src/contrib/R6_2.2.1.tar.gz'
Content type 'application/x-gzip' length 325641 bytes (318 KB)
==================================================
downloaded 318 KB
trying URL 'https://cran.rstudio.com/src/contrib/assertthat_0.2.0.tar.gz'
Content type 'application/x-gzip' length 11612 bytes (11 KB)
==================================================
downloaded 11 KB
trying URL 'https://cran.rstudio.com/src/contrib/rlang_0.1.1.tar.gz'
Content type 'application/x-gzip' length 201419 bytes (196 KB)
==================================================
downloaded 196 KB
trying URL 'https://cran.rstudio.com/src/contrib/Rcpp_0.12.11.tar.gz'
Content type 'application/x-gzip' length 2485092 bytes (2.4 MB)
==================================================
downloaded 2.4 MB
trying URL 'https://cran.rstudio.com/src/contrib/readr_1.1.1.tar.gz'
Content type 'application/x-gzip' length 233793 bytes (228 KB)
==================================================
downloaded 228 KB
trying URL 'https://cran.rstudio.com/src/contrib/hms_0.3.tar.gz'
Content type 'application/x-gzip' length 7271 bytes
==================================================
downloaded 7271 bytes
trying URL 'https://cran.rstudio.com/src/contrib/tibble_1.3.1.tar.gz'
Content type 'application/x-gzip' length 91235 bytes (89 KB)
==================================================
downloaded 89 KB
trying URL 'https://cran.rstudio.com/src/contrib/BH_1.62.0-1.tar.gz'
Content type 'application/x-gzip' length 10181096 bytes (9.7 MB)
==================================================
downloaded 9.7 MB
trying URL 'https://cran.rstudio.com/src/contrib/haven_1.0.0.tar.gz'
Content type 'application/x-gzip' length 150016 bytes (146 KB)
==================================================
downloaded 146 KB
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘R6’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘assertthat’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘rlang’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘Rcpp’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘hms’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘BH’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘tibble’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘readr’ had non-zero exit status
Error in library(haven) : there is no package called ‘haven’
Execution halted
Warning in install.packages :
installation of package ‘haven’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpia0VEs/downloaded_packages’
When I install it using the already downloaded package, it says
> install.packages("/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz")
Installing package into ‘/home/jblocher/R/x86_64-redhat-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz’ is not available (for R version 3.3.3)
If you are providing an archive file to install.packages you may need to specify repos=NULL:
install.packages("/tmp/Rtmp2Rh9Zr/downloaded_packages/haven_1.0.0.tar.gz", repos=NULL)
On my EC2 instance, I ran into the same problems when trying to install packages on RStudio, e.g., car, that involve RAM-intensive compilations. This could be fixed by adding swap space as described here
http://www.exegetic.biz/blog/2015/06/amazon-ec2-adding-swap/

Resources