install rgdal in windows - r

I want to read hdf4(MODIS) files in R using rgdal package, so I downloaded the additional hdf4 drivers by OSGeo4W, and then tried to install rgdal using source. The result is shown below:
install.packages("rgdal",type = "source")
Installing package into ‘C:/Users/dell/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified) trying URL
'https://mirrors.ustc.edu.cn/CRAN/src/contrib/rgdal_1.2-5.tar.gz'
Content type 'application/gzip' length 1652472 bytes (1.6 MB)
downloaded 1.6 MB
installing source package 'rgdal' ...
** package 'rgdal' successfully unpacked and MD5 sums checked Warning: running command 'sh ./configure.win' had status 127 ERROR:
configuration failed for package 'rgdal'
removing 'C:/Users/dell/Documents/R/win-library/3.3/rgdal' Warning in install.packages : running command
'"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l
"C:\Users\dell\Documents\R\win-library\3.3"
C:\Users\dell\AppData\Local\Temp\Rtmpywb4tp/downloaded_packages/rgdal_1.2-5.tar.gz'
had status 1 Warning in install.packages : installation of package
‘rgdal’ had non-zero exit status
Is this method wrong, or missing some crucial steps? I use R in Windows 10.

Related

Can no longer install rgeos and rgdal in R

I cannot install rgeos or rgdal packages in R version 4.1.3. These packages worked fine a month ago before I reformatted my computer and reinstalled R.
This is what I have tried:
install.packages('rgeos', type="source")
install.packages('rgdal', type="source")
This is the message I get when installing - and I DO have Rtools installed.
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/bhauptman/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/rgeos_0.5-9.tar.gz'
Content type 'application/x-gzip' length 290240 bytes (283 KB)
downloaded 283 KB
* installing *source* package 'rgeos' ...
** package 'rgeos' successfully unpacked and MD5 sums checked
** using staged installation
**********************************************
WARNING: this package has a configure script
It probably needs manual configuration
**********************************************
** libs
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'rgeos'
* removing 'C:/Users/bhauptman/Documents/R/win-library/4.1/rgeos'
* restoring previous 'C:/Users/bhauptman/Documents/R/win-library/4.1/rgeos'
Warning in install.packages :
installation of package ‘rgeos’ had non-zero exit status
The downloaded source packages are in ‘C:\Users\bhauptman\AppData\Local\Temp\Rtmp0sTf6q\downloaded_packages’

R rJava will not install on Windows 10

I am trying to install RWeka in RStudio 1.2.5033
I have tried many different ways to install it, I re-installed Java64. Here is my latest try:
install.packages("rJava")
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/Jesse's PC/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
rJava 0.9-12 0.9-13 TRUE
installing the source package ‘rJava’
trying URL 'https://cran.rstudio.com/src/contrib/rJava_0.9-13.tar.gz'
Content type 'application/x-gzip' length 664898 bytes (649 KB)
downloaded 649 KB
* installing *source* package 'rJava' ...
** package 'rJava' successfully unpacked and MD5 sums checked
** using staged installation
Generate Windows-specific files (src/jvm-w32) ...
make: Entering directory '/c/Users/JESSE'~1/AppData/Local/Temp/RtmpuOekjT/R.INSTALL24344ae86868/rJava/src/jvm-w32'
c:/Rtools/mingw_64/bin/dlltool --as c:/Rtools/mingw_64/bin/as --input-def jvm64.def --kill-at --dllname jvm.dll --output-lib libjvm.dll.a
make: c:/Rtools/mingw_64/bin/dlltool: Command not found
make: *** [Makefile:20: libjvm.dll.a] Error 127
make: Leaving directory '/c/Users/JESSE'~1/AppData/Local/Temp/RtmpuOekjT/R.INSTALL24344ae86868/rJava/src/jvm-w32'
ERROR: configuration failed for package 'rJava'
* removing 'C:/Users/Jesse's PC/Documents/R/win-library/3.6/rJava'
* restoring previous 'C:/Users/Jesse's PC/Documents/R/win-library/3.6/rJava'
Warning in install.packages :
installation of package ‘rJava’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Jesse's PC\AppData\Local\Temp\Rtmps5Y5TC\downloaded_packages’

I can't seem to install the 'ecospat' package on R studio for windows

I am unable to install the 'ecospat' package on R and I was wondering why this could be?
After running the following bit of code using R in windows.....
install.packages('ecospat')
This is the error message I get...
Installing package into ‘C:/Users/etelford.IC.000/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘pROC’, ‘biomod2’
There are binary versions available but the source versions are later:
binary source needs_compilation
pROC 1.14.0 1.16.2 TRUE
biomod2 3.3-7.1 3.4.6 FALSE
ecospat 3.0 3.1 FALSE
Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/pROC_1.14.0.zip'
Content type 'application/zip' length 941305 bytes (919 KB)
downloaded 919 KB
package ‘pROC’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\etelford.IC.000\AppData\Local\Temp\RtmpsBJC01\downloaded_packages
installing the source packages ‘biomod2’, ‘ecospat’
trying URL 'https://cran.rstudio.com/src/contrib/biomod2_3.4.6.tar.gz'
Content type 'application/x-gzip' length 665227 bytes (649 KB)
downloaded 649 KB
trying URL 'https://cran.rstudio.com/src/contrib/ecospat_3.1.tar.gz'
Content type 'application/x-gzip' length 2179055 bytes (2.1 MB)
downloaded 2.1 MB
installing source package 'biomod2' ...
** package 'biomod2' successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace 'pROC' 1.14.0 is being loaded, but >= 1.15.0 is required
ERROR: lazy loading failed for package 'biomod2'
removing 'C:/Users/etelford.IC.000/Documents/R/win-library/3.4/biomod2'
In R CMD INSTALL
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\Users\etelford.IC.000\Documents\R\win-library\3.4" C:\Users\ETELFO~1.000\AppData\Local\Temp\RtmpsBJC01/downloaded_packages/biomod2_3.4.6.tar.gz' had status 1
Warning in install.packages :
installation of package ‘biomod2’ had non-zero exit status
ERROR: dependency 'biomod2' is not available for package 'ecospat'
removing 'C:/Users/etelford.IC.000/Documents/R/win-library/3.4/ecospat'
In R CMD INSTALL
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\Users\etelford.IC.000\Documents\R\win-library\3.4" C:\Users\ETELFO~1.000\AppData\Local\Temp\RtmpsBJC01/downloaded_packages/ecospat_3.1.tar.gz' had status 1
Warning in install.packages :
installation of package ‘ecospat’ had non-zero exit status
Any help would be greatly appreciated,
thanks
First of all you need to update your R version. I think you use an R 3.4 version.
The main reason why your installation fails is that you need to install pROC > 1.15 and this is not available for R 3.4.

error installing package "devtools" in R

> install.packages("devtools")
Installing package into ‘C:/Users/hyunj/OneDrive/문서/R/win-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependency ‘withr’
There is a binary version available but
the source version is later:
binary source needs_compilation
withr 2.1.1 2.1.2 FALSE
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.4/devtools_1.13.5.zip'
Content type 'application/zip' length 443954 bytes (433 KB)
downloaded 433 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\hyunj\AppData\Local\Temp\RtmpayZaSB\downloaded_packages
installing the source package ‘withr’
trying URL 'https://cran.rstudio.com/src/contrib/withr_2.1.2.tar.gz'
Content type 'application/x-gzip' length 53578 bytes (52 KB)
downloaded 52 KB
* installing *source* package 'withr' ...
** package 'withr' successfully unpacked and MD5 sums checked
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/hyunj/OneDrive/9.<-/R/win-library/3.4/withr/DESCRIPTION': Invalid argument
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'withr'
* removing 'C:/Users/hyunj/OneDrive/문서/R/win-library/3.4/withr'
In R CMD INSTALL
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-34~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\hyunj\OneDrive\문서\R\win-library\3.4" C:\Users\hyunj\AppData\Local\Temp\RtmpayZaSB/downloaded_packages/withr_2.1.2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘withr’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\hyunj\AppData\Local\Temp\RtmpayZaSB\downloaded_packages’
it looks like you have localization problem. All localization problems are hard to debug. Your problem looks like to be in your path probably
C:/Users/hyunj/OneDrive/문서/R/win-library/3.4
If it would be possible to change the "문서" part for something else it might help.

Installing rsymphony package for r (non-zero exit status)

I am trying to install Rsymphony to be able to install fPortfolio.
I get an error when I try to install it;
install.packages("Rsymphony")
Installing package into ‘C:/Users/Olve/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Package which is only available in source form, and
may need compilation of C/C++/Fortran: ‘Rsymphony’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘Rsymphony’
trying URL 'http://cran.rstudio.com/src/contrib/Rsymphony_0.1-22.tar.gz'
Content type 'application/x-gzip' length 7447 bytes
downloaded 7447 bytes
installing source package 'Rsymphony' ...
** package 'Rsymphony' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'Rsymphony'
removing 'C:/Users/Olve/Documents/R/win-library/3.3/Rsymphony'
restoring previous 'C:/Users/Olve/Documents/R/win-library/3.3/Rsymphony'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\Olve\Documents\R\win-library\3.3" C:\Users\Olve\AppData\Local\Temp\RtmpUjRTsG/downloaded_packages/Rsymphony_0.1-22.tar.gz' had status 1
Warning in install.packages :
installation of package ‘Rsymphony’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Olve\AppData\Local\Temp\RtmpUjRTsG\downloaded_packages’
I use RStudio with R 3.3 and Windows 7 64bit, most of the other posts I have seen related to this is from OSX users getting slightly different error messages, and none of their solutions have helped me (downloading and installing symphony, not sure if i have done this correctly either)
Edit: Stedy's solution worked, thanks.
Since its a Windows 7 machine, you will want to use the zip file instead of the tar file:
> install.packages('Rsymphony')
Installing package into ‘C:/Users/zstednic/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘Rsymphony’
These will not be installed
> install.packages('Rsymphony_0.1-22.zip', repos=NULL)
Installing package into ‘C:/Users/zstednic/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
package ‘Rsymphony’ successfully unpacked and MD5 sums checked
> library(Rsymphony)
>

Resources