par1 <- as.numeric(par1) bitmap(file='test1.png') if (is.na(par1)) { myhist<-hist(x,col=par2) } else { if (par1 < 0) par1 <- 3 if (par1 > 50) par1 <- 50 myhist<-hist(x,breaks=par1,col=par2) } dev.off() myhist n <- length(x) load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,hyperlink('histogram.htm','Frequency Table (Histogram)',''),6,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Bins',header=TRUE) a<-table.element(a,'Midpoint',header=TRUE) a<-table.element(a,'Abs. Frequency',header=TRUE) a<-table.element(a,'Rel. Frequency',header=TRUE) a<-table.element(a,'Cumul. Rel. Freq.',header=TRUE) a<-table.element(a,'Density',header=TRUE) a<-table.row.end(a) crf <- 0 for (i in 1:(length(myhist$breaks)-1)) { a<-table.row.start(a) dum <- paste('[',myhist$breaks[i],sep='') dum <- paste(dum,myhist$breaks[i+1],sep=',') dum <- paste(dum,'[',sep='') a<-table.element(a,dum,header=TRUE) a<-table.element(a,myhist$mids[i]) a<-table.element(a,myhist$counts[i]) rf <- myhist$counts[i]/n crf <- crf + rf a<-table.element(a,round(rf,6)) a<-table.element(a,round(crf,6)) a<-table.element(a,round(myhist$density[i],6)) a<-table.row.end(a) } a<-table.end(a) table.save(a,file='mytable.tab')
|