#COLLATION HADCRUT3 #download the following #http://hadobs.metoffice.com/hadcrut3/data/HadCRUT3.nc #put into a directory called url #I've used "d:/climate/data/jones" #in R go to the Packages command and install package ncdf from r-project.org #after you've done this do the following library(ncdf) url<-"d:/climate/data/jones" loc<-file.path(url,"HadCRUT3.nc" ) #[1] "c" v<-open.ncdf(loc) #test <- v$var[[1]] #test$size # 72 36 1 1883 #test$dim[[1]]$vals #[1] -177.5 -172.5 -167.5 -162.5 -157.5 -152.5 -147 #test$dim[[2]]$vals # [1] -87.5 -82.5 -77.5 -72.5 -67.5 -62.5 -57.5 instr <- get.var.ncdf( v, v$var[[1]]) # 1856 2005 dim(instr)# [1] 72 36 1883 #this is organized in 72 longitudes from -177.5 to 177.5 and 36 latitudes from -87.5 to 87.5 ##here's a simple little function to obtain long-lat indices from longitude;latitude combinations jlo<-function(long,lat){ lat<- 19+ floor(lat/5 +.01); long<- 37+ floor(long/5 +.01); jlo<-c(long,lat);jlo } #here's aplot of gridcell test<-jlo(5,52) y<-instr[test[1],test[2],]; plot.ts(y)