incomplete downloading error while installing a package in R - r

i am trying to install lubridate package in r using following syntax
install.packages("lubridate")
but it is throwing a error by saying that it is not able to download package completely
below is the error where you can see that downloaded size is not equal to reported size
Installing package into ‘C:/Users/vikas.mittal/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'http://cran.us.r-project.org/bin/windows/contrib/3.3/lubridate_1.6.0.zip'
Content type 'application/zip' length 654286 bytes (638 KB)
downloaded 248 KB
Warning in install.packages :
downloaded length 253952 != reported length 654286
Warning in install.packages :
error 1 in extracting from zip file
Warning in install.packages :
cannot open compressed file 'lubridate/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection

Related

Trouble installing glmmTMB

I was using glmmTMB on a cluster. It was working for several weeks. I logged on today and it says I need to install glmmTMB. So, I tried that, but R is giving me the error below.
The main part says: failed to lock directory.
Thanks for any advice.
Installing package into ‘/home/xxxxxx/R/x86_64-redhat-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/glmmTMB_1.1.2.3.tar.gz'
Content type 'application/x-gzip' length 3910643 bytes (3.7 MB)
==================================================
downloaded 3.7 MB
ERROR: failed to lock directory ‘/home/xxxxxx/R/x86_64-redhat-linux-gnu-library/4.0’ for modifying
Try removing ‘/home/xxxxxx/R/x86_64-redhat-linux-gnu-library/4.0/00LOCK-glmmTMB’
Warning in install.packages :
installation of package ‘glmmTMB’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpYJgfa7/downloaded_packages’

install.packages() having issues with setwd()

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’

Why plotly fails to install using R-Studio but not in R?

OS: Ubuntu 17.1
I have tried to install plotly on R studio using install.packages("plotly")
It failed with the following log:
Installing package into ‘/home/company/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘htmlwidgets’, ‘hexbin’, ‘crosstalk’, ‘data.table’
trying URL 'https://cloud.r-project.org/src/contrib/htmlwidgets_1.0.tar.gz'
Warning in install.packages :
cannot open URL 'https://cloud.r-project.org/src/contrib/htmlwidgets_1.0.tar.gz': HTTP status was '404 Not Found'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://cloud.r-project.org/src/contrib/htmlwidgets_1.0.tar.gz'
Warning in install.packages :
download of package ‘htmlwidgets’ failed
trying URL 'https://cloud.r-project.org/src/contrib/hexbin_1.27.2.tar.gz'
Content type 'application/x-gzip' length 491560 bytes (480 KB)
==================================================
downloaded 480 KB
trying URL 'https://cloud.r-project.org/src/contrib/crosstalk_1.0.0.tar.gz'
Content type 'application/x-gzip' length 563474 bytes (550 KB)
==================================================
downloaded 550 KB
trying URL 'https://cloud.r-project.org/src/contrib/data.table_1.10.4-3.tar.gz'
Content type 'application/x-gzip' length 3071833 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
trying URL 'https://cloud.r-project.org/src/contrib/plotly_4.7.1.tar.gz'
Content type 'application/x-gzip' length 1034951 bytes (1010 KB)
==================================================
downloaded 1010 KB
Warning in install.packages :
system call failed: Cannot allocate memory
Warning in install.packages :
installation of package ‘hexbin’ had non-zero exit status
Warning in install.packages :
system call failed: Cannot allocate memory
Warning in install.packages :
installation of package ‘crosstalk’ had non-zero exit status
Warning in install.packages :
system call failed: Cannot allocate memory
Warning in install.packages :
installation of package ‘data.table’ had non-zero exit status
Warning in install.packages :
system call failed: Cannot allocate memory
Warning in install.packages :
installation of package ‘plotly’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpTFlAaE/downloaded_packages’
For some reason it can't allocate memory but in R it succeeds?
What is wrong here? Please advise why can't I install it straight forward?
You should try to install the development version of plotly (on GitHub) via devtools:
devtools::install_github("ropensci/plotly")

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/

Cannot install package Rmysql

When I try the following command
install.packages('RMySQL',type='source')
I got an error as below
Installing into ‘C:/Users/Thanushiya/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'http://ftp.iitm.ac.in/cran/src/contrib/RMySQL_0.10.6.tar.gz'
Content type 'application/x-gzip' length 52407 bytes (51 KB)
downloaded 36 KB
Error in untar2(tarfile, files, list, exdir, restore_times) :
incomplete block on file
The downloaded source packages are in
‘C:\Users\Thanushiya\AppData\Local\Temp\RtmpSMF6pv\downloaded_packages’
Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 36864 != reported length 52407
2: running command '"C:/PROGRA~1/R/R-32~1.2/bin/i386/R" CMD INSTALL -l "C:\Users\Thanushiya\Documents\R\win-library\3.2" C:\Users\THANUS~1\AppData\Local\Temp\RtmpSMF6pv/downloaded_packages/RMySQL_0.10.6.tar.gz' had status 1
3: In install.packages("RMySQL", type = "source") :
installation of package ‘RMySQL’ had non-zero exit status

Resources