Cannot install package Rmysql - r

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

Related

package ‘GEOquery’ is not available (for R version 3.6.1)

In my windows 10 enviornment with latest version of R and RStudio, I am not able to download many of R packages like I mentioned, similarly R bioconductor package I am not being able to download,So whats the problem?
install.packages('GEOquery')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/samer/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘GEOquery’ is not available (for R version 3.6.1)
install.packages('bioconductor')
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/samer/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘bioconductor’ is not available (for R version 3.6.1)
Update:
I downloaded and installed Rtools from the direct link instead from within the RStudio Environment.
Then I have following issues now.
BiocManager::install("GEOquery")
Bioconductor version 3.9 (BiocManager 1.30.7), R 3.6.1 (2019-07-05)
Installing package(s) 'BiocVersion', 'GEOquery'
also installing the dependencies ‘rlang’, ‘tidyselect’, ‘plogr’, ‘ellipsis’, ‘purrr’, ‘vctrs’, ‘lifecycle’, ‘Biobase’, ‘readr’, ‘xml2’, ‘dplyr’, ‘tidyr’, ‘limma’
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/rlang_0.4.0.zip'
Content type 'application/zip' length 1090422 bytes (1.0 MB)
downloaded 1.0 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidyselect_0.2.5.zip'
Content type 'application/zip' length 627063 bytes (612 KB)
downloaded 612 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/plogr_0.2.0.zip'
Content type 'application/zip' length 18873 bytes (18 KB)
downloaded 18 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/ellipsis_0.3.0.zip'
Content type 'application/zip' length 44553 bytes (43 KB)
downloaded 43 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/purrr_0.3.2.zip'
Content type 'application/zip' length 421098 bytes (411 KB)
downloaded 411 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/vctrs_0.2.0.zip'
Content type 'application/zip' length 828462 bytes (809 KB)
downloaded 809 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/lifecycle_0.1.0.zip'
Content type 'application/zip' length 84709 bytes (82 KB)
downloaded 82 KB
trying URL 'https://bioconductor.org/packages/3.9/bioc/bin/windows/contrib/3.6/Biobase_2.44.0.zip'
Content type 'application/zip' length 2421976 bytes (2.3 MB)
downloaded 2.3 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/readr_1.3.1.zip'
Content type 'application/zip' length 1589745 bytes (1.5 MB)
downloaded 1.5 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/xml2_1.2.2.zip'
Content type 'application/zip' length 3503035 bytes (3.3 MB)
downloaded 3.3 MB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/dplyr_0.8.3.zip'
Content type 'application/zip' length 3265027 bytes (3.1 MB)
downloaded 764 KB
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidyr_1.0.0.zip'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/tidyr_1.0.0.zip'
In addition: Warning messages:
1: In download.file(url, destfile, method, mode = "wb", ...) :
downloaded length 782336 != reported length 3265027
2: In download.file(url, destfile, method, mode = "wb", ...) :
InternetOpenUrl failed: 'The server returned an invalid or unrecognized response'
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘tidyr’ failed
trying URL 'https://bioconductor.org/packages/3.9/bioc/bin/windows/contrib/3.6/limma_3.40.6.zip'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://bioconductor.org/packages/3.9/bioc/bin/windows/contrib/3.6/limma_3.40.6.zip'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
InternetOpenUrl failed: 'The operation timed out'
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘limma’ failed
trying URL 'https://bioconductor.org/packages/3.9/bioc/bin/windows/contrib/3.6/BiocVersion_3.9.0.zip'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://bioconductor.org/packages/3.9/bioc/bin/windows/contrib/3.6/BiocVersion_3.9.0.zip'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
InternetOpenUrl failed: 'The operation timed out'
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘BiocVersion’ failed
trying URL 'https://bioconductor.org/packages/3.9/bioc/bin/windows/contrib/3.6/GEOquery_2.52.0.zip'
Error in download.file(url, destfile, method, mode = "wb", ...) :
cannot open URL 'https://bioconductor.org/packages/3.9/bioc/bin/windows/contrib/3.6/GEOquery_2.52.0.zip'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
InternetOpenUrl failed: 'The operation timed out'
Warning in download.packages(pkgs, destdir = tmpd, available = available, :
download of package ‘GEOquery’ failed
package ‘rlang’ successfully unpacked and MD5 sums checked
package ‘tidyselect’ successfully unpacked and MD5 sums checked
package ‘plogr’ successfully unpacked and MD5 sums checked
package ‘ellipsis’ successfully unpacked and MD5 sums checked
package ‘purrr’ successfully unpacked and MD5 sums checked
package ‘vctrs’ successfully unpacked and MD5 sums checked
package ‘lifecycle’ successfully unpacked and MD5 sums checked
package ‘Biobase’ successfully unpacked and MD5 sums checked
package ‘readr’ successfully unpacked and MD5 sums checked
package ‘xml2’ successfully unpacked and MD5 sums checked
Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open the connection
In addition: Warning messages:
1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file
2: In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open compressed file 'dplyr/DESCRIPTION', probable reason 'No such file or directory'
To install bioconductor packages is not like normal R packages. To do so, follow the steps here:
Example Code:
source("https://bioconductor.org/biocLite.R")
BiocInstaller::biocLite(c("GEOquery"))
To install Rtools get the latest download from here and install it, then re-try the code.
Edit:
Apparently there are updated installation practices, so the correct code should be:
BiocManager::install("GEOquery")

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/

incomplete downloading error while installing a package in 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

Resources