Hi there, I am using climate model data in attempt to create a time series for a specific location. Getting longitude and latitude is fine. However, I am receiving the following error when using the "ncvar_get" function in trying to derive the "time" dimension: Error in nc$dim[[idobj$list_index]] : attempt to select more than one element in get1index <real> What could be causing this? -This is what I have done so far: #CanESM2 plotting for specified yearncfname<-"MaxPrecCCCMACanESM2rcp45.nc" Prec<-raster(ncfname) print(Prec) Model<-nc_open(ncfname)longitude<-ncvar_get(Model, "lon") #Works fine latitude<-ncvar_get(Model, "lat") #Works fine time<-ncvar_get(Model, "time") #Error in nc$dim[[idobj$list_index]] : attempt to select more than one element in get1index <real>
Here is the structure of the file after using "nc_open": File MaxPrecCCCMACanESM2rcp45.nc (NC_FORMAT_NETCDF4): 3 variables (excluding dimension variables): double onedaymax[lon,lat,time] (Contiguous storage) units: mm/day double fivedaymax[lon,lat,time] (Contiguous storage) units: mm/day short Year[time] (Contiguous storage) 3 dimensions: time Size:95 lat Size:64 units: degree North lon Size:128 units: degree East What could be causing this error? Thanks in advance, and I look forward to your response! [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.