2

I want to run library(ncdf) in R version 3.3.0. I am getting following error message: Failed with error: ‘package ‘ncdf’ was built before R 3.0.0: please re-install it’

I tried in foll. way as suggested:

url <- "https://cran.r-project.org/src/contrib/Archive/ncdf/ncdf_1.6.9.tar.gz"
pkgFile <- "ncdf_1.6.9.tar.gz"
download.file(url = url, destfile = pkgFile)
install.packages(c("ada", "ipred", "evd"))
install.packages(pkgs=pkgFile, type="source", repos=NULL)

sessionInfo()

R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 10586)

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base 

I am still getting some error:

Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-33~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB="ncdf.dll" WIN=64 TCLBIN=64 OBJECTS="ncdf.o ncdf2.o ncdf3.o"' had status 127
ERROR: compilation failed for package 'ncdf'
* removing 'C:/Users/gangulip/Documents/R/win-library/3.3/ncdf'
* restoring previous 'C:/Users/gangulip/Documents/R/win-library/3.3/ncdf'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-33~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\gangulip\Documents\R\win-library\3.3" "ncdf_1.6.9.tar.gz"' had status 1 
2: In install.packages(pkgs = pkgFile, type = "source", repos = NULL,  :
  installation of package ‘ncdf_1.6.9.tar.gz’ had non-zero exit status
Poulomi
  • 25
  • 5
  • see https://cran.r-project.org/web/packages/ncdf/index.html – user20650 Jul 20 '16 at 19:03
  • `ncdf` is discontinued. Try `ncdf4` or `RNetCDF` instead – Tung Jul 20 '16 at 19:03
  • or from the archive see http://stackoverflow.com/questions/24194409/how-do-i-install-a-package-that-has-been-archived-from-cran?answertab=votes#tab-top – user20650 Jul 20 '16 at 19:05
  • I have installed the package ncdf from archive: https://cran.r-project.org/src/contrib/Archive/ncdf/ but not sure about package dependencies. Will it be same as the link you shared? – Poulomi Jul 20 '16 at 19:10
  • I actually tried the codes shared in this link, I am getting the same error. – Poulomi Jul 20 '16 at 19:21
  • Can you edit your post with the code that you have used to try and install from the archive please. Also can you specify your `sessionInfo()`. Thanks – user20650 Jul 20 '16 at 19:22
  • Thanks for the edit: can you post the results of `sessionInfo()` please: as if you are on Windows you may need a further step – user20650 Jul 20 '16 at 19:41
  • yes I am using windows but I didn't get what is sessionInfo(), can you please elaborate. If I type sessionInfo() I received some messages which I have already posted in the message. – Poulomi Jul 20 '16 at 19:47
  • by typing `sessionInfo()` into your R session it should print info on what R version, your operating system etc. If not, start a new R session and try again. Also as you are on Windows you will need Rtools. Install the relvent exe from here https://cran.r-project.org/bin/windows/Rtools/ – user20650 Jul 20 '16 at 19:50
  • okay, i have got it to work on ubuntu using the comment to dirks answer http://stackoverflow.com/questions/17028465/installation-of-package-ncdf-fails-due-to-missing-header-although-its-there. I used `install.packages(pkgs=pkgFile, type="source", repos=NULL, configure.args="--with-netcdf-include=/usr/include")` (ps you dont need the dpendencies in your code) – user20650 Jul 20 '16 at 19:52
  • pps. After i installed `ncdf` and loaded it i got this message. `library(ncdf); *Package 'ncdf' is deprecated and will be removed from CRAN shortly. Use instead package RNetCDF or ncdf4 (for Windows from CRANextras)*`. So perhaps bite the bullet and move to the new package. – user20650 Jul 20 '16 at 19:55
  • OK. I am still getting some error.. I'll move to new package – Poulomi Jul 20 '16 at 20:00
  • okay, I just tried on a Windows partition, and also no luck . Sorry I dont know how to set the configure args . Hopefully someone more experienced will offer help – user20650 Jul 20 '16 at 20:23

0 Answers0