Thanks for the example.

]]>I can’t get your code running (“header$Data.type.code”, “g(mann[[ index[i] ]])” and “filter.combine.pad” don’t run) so I tweaked it my way. I don’t know why your chronA..D so don’t know where I can help.

Now things are much clearer to me : (see my graphs here

http://pichuile.free.fr/ecad/mann2008 )

You see strange things when data are not filtered in code 5000 and 8001. And of course, that 927 proxies of 1209 are tree rings.

library(gplots)

source("http://www.climateaudit.org/scripts/utilities.txt")

download.file("http://www.climateaudit.org/data/mann.2008/mann.tab","temp.dat",mode="wb");load("temp.dat")

download.file("http://www.climateaudit.org/data/mann.2008/details.tab","temp.dat",mode="wb");load("temp.dat")

```
```proxiname=c("Miscellaneous","Composite","Marine sediments","Miscellaneous","Miscellaneous",

"Miscellaneous","Miscellaneous","Miscellaneous" ,"Miscellaneous" ,"Miscellaneous" ,"Miscellaneous" ,

"Tree latewood density","Oxygen isotopes","Miscellaneous","Tree width")

codelist=as.numeric(levels(details$code))

for(j in 1:length(codelist))

{

y=mann[details$code== codelist[j]]

chronA=NULL

for ( dat in y)

{

X=ts(dat[,2], start=dat[1,1]) ##convert to time series

temp2=(time(X)>=1850)&(time(X)<=1995) ##collect mann proxy calibration into temp

m0=mean(X[temp2],na.rm=T)

sd0=sd(X[temp2],na.rm=T) ##Calc mean and standard deviation

Xscaled=(scale(X[],center=m0,scale=sd0)) ##Linear scaling of temp

Xscaled=ts(Xscaled,start=time(X)[1]) ##Cram it back into time series

chronA=ts.union(chronA,Xscaled ) ##stick everything into time series array

}

` Y=ts(apply(chronA,1,mean,na.rm=T),start=tsp(chronA)[1]) ##average time series`

plot(Y,col=2,type="l",las=1,xlab="Year",ylab="values scaled to 1 sigma mean",xlim=c(0,2000), ylim = c(-3,3))

title(paste(proxiname[j]," (code=",codelist[j], ") / ",length(y)," proxies",sep=""))

abline(h=seq(-3,3,1), v=seq(0,2000,500),col="gray", lty="dotted", add=T)

lines(Y,col=2)

savePlot(paste("c:/agw/Average of Proxy Type =",codelist[j]),type="jpg")

}

#

Keep up the good work.

]]>———————

library(gplots)

source(“http://www.climateaudit.org/scripts/utilities.txt”)

download.file(“http://www.climateaudit.org/data/mann.2008/mann.tab”,”temp.dat”,mode=”wb”);load(“temp.dat”)

download.file(“http://www.climateaudit.org/data/mann.2008/details.tab”,”temp.dat”,mode=”wb”);load(“temp.dat”)

codelist=NULL

for(j in 1:10000)

{

temp=(details$code==j)

K=sum(temp)

if(K>0)

{

codelist[length(codelist)+1]=j

}

}

for(j in 1:length(codelist))

{

temp=header$Data.type.code==codelist[j]

K=sum (temp)

index=(1:1209)[temp]

chronA=NULL

chronB=NULL

chronC=NULL

chronD=NULL

for ( i in 1:K)

{

X=g(mann[[ index[i] ]]) ##convert to time series

temp2=(time(X)>=1850)&(time(X)<=1995) ##collect mann proxy calibration into temp

m0=mean(X[temp2],na.rm=T)

sd0=sd(X[temp2],na.rm=T) ##Calc mean and standard deviation

Xscaled=(scale(X[],center=m0,scale=sd0)) ##Linear scaling of temp

Xscaled=ts(Xscaled,start=time(X)[1]) ##Cram it back into time series

if(i<250)

{

chronA=ts.union(chronA,Xscaled ) ##stick everything into time series array

}

else

{

if(i<500)

{

chronB=ts.union(chronB,Xscaled ) ##stick everything into time series array

}

else

{

if(i<750)

{

chronC=ts.union(chronC,Xscaled ) ##stick everything into time series array

}

else

{

chronD=ts.union(chronD,Xscaled ) ##stick everything into time series array

}

}

}

}

if(length(chronB)!=0)

{

chronA=ts.union(chronA,chronB)

}

if(length(chronC)!=0)

{

chronA=ts.union(chronA,chronC)

}

if(length(chronD)!=0)

{

chronA=ts.union(chronA,chronD)

}

mannavg=ts(apply(chronA,1,mean,na.rm=T),start=tsp(chronA)[1]) ##average time series

Y=mannavg;##//ts.union(annual,mannavg) ##cram time series into Y

f=function(x) filter.combine.pad(x,truncated.gauss.weights(11) )[,2] ##filter functionh

plot(time(Y),f(Y),col=2,type=”l”,lwd=2,las=1,ylab=””,xlab=”Year”,xlim=c(0,2000), ylim = c(-5,5))

title(paste(“Average of Proxy Type =”,codelist[j]))

##savePlot(paste(“c:/agw/r/Average of Proxy Type =”,codelist[j]),type=”jpg”)

}

It should run as is.

]]>There is an answer though. On Climate Audit, (Link on the right) Steve McIntyre made gif based movies of the proxies which play one after another on the screen in standardized units, he even had a way to download the movie file.

The posts were around the beginning of September08 and there were several of them. It was a bit jaw dropping for me.

I hope that helps.

]]>I tried to upload it today and apparently I mad a mistake and didn’t save the final version of my code. I have something close though so I will fix it and post tonight after work. That’s the main reason I am learning R, so people can review my work easily. C++ would be huge to go through.

Perhaps you can help me, I needed to make an indexed array of time series so I could join them in a ts.union. The function becomes very slow when the union grows large. I gave up after a couple of hours but what I needed was to address a bunch of time series like this x[i]. I ended up just typing in 4 series like xa, xb, xc, xd. It was a pain but it got the job done.

You’ll see what I mean later.

]]>Can you post your R script please ? (don’t forget to enclose it with

`)`

I would like to change the graphs' title to "Icecores : x / 1029 proxies", "Tree ring width: y / 1029 proxies" ...

]]>You are exactly where I was not that long ago. I have a link which answers some of your questions.

I hope you like it.

]]>As they are all different, which are truthful regarding “temperature” and which are false and how do you tell?

Or is it just those that are Hocky stick shaped measure temperature?

]]>