#http://hadobs.metoffice.com/hadsst2/diagnostics/global/nh+sh/monthly # get.hadsst=function(hemi="gl",period="monthly",verbose="default") { # hemi="gl"; period="monthly";verbose="default" index=c(gl="global/nh+sh",nh="hemispheric/northern",sh="hemispheric/southern",trp="regional/30-30", nh_ext="regional/north_30n", sh_ext="regional/south_30s" ) if(period=="monthly") { loc=file.path("http://hadobs.metoffice.com/hadsst2/diagnostics",index[paste(hemi)],"monthly" ) download.file(loc,"temp") D=read.table("temp") #dim(D) #1928 12 #start 1850 names(D)=c("year","anom","u_sample","l_sample","u_coverage","l_coverage","u_bias","l_bias","u_sample_cover","l_sample_cover", "u_total","l_total") monthly=ts(D[,2],start=c(1850,1),freq=12) return(monthly) } # monthly if(period=="annual") { loc=file.path("http://hadobs.metoffice.com/hadcrut3/diagnostics",index[paste(hemi)],"annual" ) D=read.table(loc) #dim(D) #158 12 #start 1850 names(D)=c("year","anom","u_sample","l_sample","u_coverage","l_coverage","u_bias","l_bias","u_sample_cover","l_sample_cover", "u_total","l_total") annual=ts(D[,2],start=1850 ) return(annual) } #annual } # had=get.hadsst(hemi="gl",period="annual")