Hi ,everyone.

I want to draw a boxplot figure, main script shown as below. when I run the
command "boxplot(bjavee~yearname)",it is wrong with the error information "
model.frame.default(formula = bjavee ~ yearname) :
  variation 'bjavee' list is wrong".

I want to add the yearname as the x-axis tick. And yearname is a array with
the length 12,while bjavee is a 5*12 matrix. How could I get what I want?
thanks.

bjerr1<-bjerrdata$tyerr[1:bjyearnum[2]]
bjerr2<-bjerrdata$tyerr[(bjyearnum[2]+1):bjyearnum[3]]
bjerr3<-bjerrdata$tyerr[(bjyearnum[3]+1):bjyearnum[4]]
bjerr4<-bjerrdata$tyerr[(bjyearnum[4]+1):bjyearnum[5]]
bjerr5<-bjerrdata$tyerr[(bjyearnum[5]+1):bjyearnum[6]]
bjerr6<-bjerrdata$tyerr[(bjyearnum[6]+1):bjyearnum[7]]
bjerr7<-bjerrdata$tyerr[(bjyearnum[7]+1):bjyearnum[8]]
bjerr8<-bjerrdata$tyerr[(bjyearnum[8]+1):bjyearnum[9]]
bjerr9<-bjerrdata$tyerr[(bjyearnum[9]+1):bjyearnum[10]]
bjerr10<-bjerrdata$tyerr[(bjyearnum[10]+1):bjyearnum[11]]
bjerr11<-bjerrdata$tyerr[(bjyearnum[11]+1):bjyearnum[12]]
bjerr12<-bjerrdata$tyerr[(bjyearnum[12]+1):length(bjerryear)]

bjavee<-data.frame(5,12)
cprob=c(0.05,0.25,0.5,0.75,0.95)
bjavee[1:5,1]<-quantile(bjerr1,prob=cprob)
bjavee[1:5,2]<-quantile(bjerr2,prob=cprob)
bjavee[1:5,3]<-quantile(bjerr3,prob=cprob)
bjavee[1:5,4]<-quantile(bjerr4,prob=cprob)
bjavee[1:5,5]<-quantile(bjerr5,prob=cprob)
bjavee[1:5,6]<-quantile(bjerr6,prob=cprob)
bjavee[1:5,7]<-quantile(bjerr7,prob=cprob)
bjavee[1:5,8]<-quantile(bjerr8,prob=cprob)
bjavee[1:5,9]<-quantile(bjerr9,prob=cprob)
bjavee[1:5,10]<-quantile(bjerr10,prob=cprob)
bjavee[1:5,11]<-quantile(bjerr11,prob=cprob)
bjavee[1:5,12]<-quantile(bjerr12,prob=cprob)


yearname<-(1997:2008)

png(file=".\\png\\jptrkfivenum24.png", bg="transparent")

bjbox<-data.frame(bjavee[1:5,1],bjavee[1:5,2],bjavee[1:5,3],bjavee[1:5,4],bjavee[1:5,5],bjavee[1:5,6],bjavee[1:5,7],bjavee[1:5,8],bjavee[1:5,9],bjavee[1:5,10],bjavee[1:5,11],bjavee[1:5,12])
boxplot(bjavee~yearname)




-- 
TANG Jie
Email: totangjie@gmail.com
Tel: 0086-2154896104
Shanghai Typhoon Institute,China

	[[alternative HTML version deleted]]


