[R] rgdal error when trying to import raster

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Thu Sep 7 01:20:30 CEST 2017

Indeed, Ben, but the question was something more like it is not a Dependency, just Suggested, so why the error...


If you read the Introduction to the 'raster' package vignette, it indicates that some input formats are supported within the raster package and some rely on other packages. Clearly the attempt to read a TIFF was an example of the latter. Had you used a different input file format the issue of rgdal might never have appeared... ergo, Suggests rather than Depends. 

Note that someone may feel pity for your plight, John, and give you a convenient alternative way to import the data to raster (there are other packages that read TIFF but you would probably have to roll the geolocation yourself... an avenue for which help would be better pursued on R-sig-geo), but the premise of your email (cannot upgrade) does put it squarely in the off-topic category according to the Posting Guide. Fortunately R is open-source so if you are diligent you can write/borrow R code as needed or even recompile R and necessary packages entirely within your personal development directories with no system installation to bother your sysadmin about... but you might also just go find another computer to do your work on.
Sent from my phone. Please excuse my brevity.

On September 6, 2017 3:29:41 PM PDT, Ben Tupper <btupper at bigelow.org> wrote:
>The message "there is no package called 'rgdal'" means that you don't
>have rgdal installed.
>Also, you will get very good patial-centric help if you subscribed to
>r-sig-geo here
>> On Sep 6, 2017, at 2:52 PM, john polo <jpolo at mail.usf.edu> wrote:
>> Dear useRs,
>> I am trying to import a raster with the line:
>> nlcd <- raster("/home/jpolo/NRI/nlcd_nri5000.tif")
>> And I keep getting an error like this:
>> "Warning message:
>> In library(package, lib.loc = lib.loc, character.only = TRUE,
>logical.return = TRUE,  :
>>   there is no package called 'rgdal'
>> Error in .rasterObjectFromFile(x, band = band, objecttype =
>"RasterLayer",  :
>>   Cannot create RasterLayer object from this file; perhaps you need
>to install rgdal first
>> Calls: raster -> raster -> .local -> .rasterObjectFromFile
>> Execution halted"
>> This is the session info:
>> "R version 3.2.5 (2016-04-14)
>> Platform: x86_64-pc-linux-gnu (64-bit)
>> Running under: CentOS release 6.3 (Final)
>> locale:
>> [1] C
>> attached base packages:
>> [1] methods   stats     graphics  grDevices utils datasets  base
>> other attached packages:
>> [1] raster_2.5-8 sp_1.2-4     rgeos_0.3-23
>> loaded via a namespace (and not attached):
>> [1] Rcpp_0.12.10    grid_3.2.5      lattice_0.20-35 "
>> I know the R version is old, but this is a system that I can not
>update, I have no control over it. Because the version of R is old, the
>admin told me that they cannot install rgdal. I am not using
>library(rgdal) and none of the other libraries that are loaded require
>rgdal. The package raster does suggest it though. Is that causing the
>problem? Is there a way to avoid this? Any help is welcome.
>> best,
>> John
>> -- 
>> "Ask a man to be quiet,
>> and he'll be silent for a moment.
>> Feed a man to a red dragon
>> and he'll be silent for a lifetime."
>> -Anne Isabella Thackeray Ritchie
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> and provide commented, minimal, self-contained, reproducible code.
>Ben Tupper
>Bigelow Laboratory for Ocean Sciences
>60 Bigelow Drive, P.O. Box 380
>East Boothbay, Maine 04544
>Ecocast Reports: http://seascapemodeling.org/ecocast.html
>Tick Reports: https://report.bigelow.org/tick/
>Jellyfish Reports: https://jellyfish.bigelow.org/jellyfish/
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list