[R-sig-Geo] Error in .local(.Object, ...) : TIFFOpen: .....Too many open files

Navinder Singh Navinder.Singh at slu.se
Thu Nov 6 00:18:12 CET 2014


Hi,
I am trying to clip or do any other calculations on a raster stack with 365 rasters with a given extent. However, i keep getting the following error.
A side note- This raster stack is saved as “.tif" and was generated using the whittaker.raster function from the MODIS package. I am unable to do any further progress on this stack due to this error.

########################################################################
> setwd("/Users/nasi/Google Drive/5KMNDVI_Clipped")

> rt<-stack("NDVI_YearlyLambda5000_year2010.tif”)

> rt
class       : RasterStack
dimensions  : 1943, 1222, 2374346, 365  (nrow, ncol, ncell, nlayers)
resolution  : 0.04999591, 0.04999228  (x, y)
extent      : -17.96, 43.135, -30.055, 67.08  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=clrk66 +no_defs
names       : NDVI_Year//year2010.1, NDVI_Year//year2010.2, NDVI_Year//year2010.3, NDVI_Year//year2010.4, NDVI_Year//year2010.5, NDVI_Year//year2010.6, NDVI_Year//year2010.7, NDVI_Year//year2010.8, NDVI_Year//year2010.9, NDVI_Year//ear2010.10, NDVI_Year//ear2010.11, NDVI_Year//ear2010.12, NDVI_Year//ear2010.13, NDVI_Year//ear2010.14, NDVI_Year//ear2010.15, ...
min values  :             -253440.3,             -252749.0,             -252057.7,             -251366.4,             -250675.1,             -249983.8,             -249292.4,             -248601.1,             -247909.8,             -247218.5,             -246527.2,             -245835.9,             -245144.6,             -244453.2,             -243761.9, ...
max values  :             130541.71,             130239.21,             129936.71,             129634.21,             129331.71,             129029.21,             128726.71,             128424.21,             128121.71,             127819.21,             127516.71,             127214.20,             126911.70,             126609.20,             126306.70, ...

decjan.sp<-SpatialPoints(decjan[,c(3,4)])
e<-bbox(decjan.sp)
e

> decjan.ran<-crop(rt,e)
Error in .local(.Object, ...) :
  TIFFOpen:/Users/nasi/Google Drive/5KMNDVI_Clipped/NDVI_YearlyLambda5000_year2010.tif: Too many open files

########################################################################
my session info is:

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] C

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

other attached packages:
 [1] adehabitatLT_0.3.16 CircStats_0.2-4     boot_1.3-11         MASS_7.3-33
 [5] adehabitatMA_0.3.8  ade4_1.6-2          plyr_1.8.1          zoo_1.7-11
 [9] rgdal_0.8-16        rasterVis_0.28      hexbin_1.26.3       latticeExtra_0.6-26
[13] RColorBrewer_1.0-5  lattice_0.20-29     raster_2.2-31       sp_1.0-15

loaded via a namespace (and not attached):
[1] Rcpp_0.11.1


Any suggestions? I have seen this error popping up in many other packages and programs too but count really find a solution relevant to R.



Navinder J Singh
Associate Professor
Department of Wildlife, Fish, and Environmental Studies
Faculty of Forest Sciences
Swedish University of Agricultural Sciences
SE-901 83 Umea, Sweden
O: +46 (0)90 786 8538;
M: +46 (0)70 676 0103
email: navinder.singh at slu.se<mailto:navinder.singh at slu.se>
Web: navinderjsingh.weebly.com<http://navinderjsingh.weebly.com/>

www.slu.se/viltfiskmiljo/navinder_singh<http://www.slu.se/viltfiskmiljo/navinder_singh>
http://slu-se.academia.edu/NSingh





	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list