R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(239050,238600,236980,236050,234870,233060,231370,230300,228340,226760,223550,221460,220560,220350,219500,218800,218130,217150,216430,215310,213780,213040,211940,212270,212540,213790,214400,215520,216690,217630,218710,219360,219800,221110,221320,225230,227340,228930,230340,231270,231830,232450,233220,233520,234520,234860,236560,238310,239690,240700,241330,241580,241670,241970,241690,241410,242130,242130,243320,242030,242740,243050,243360,243940,244270,244350,244260,244230,245130,246740,247910,249590,251610,253430,255290,256710,257190,257820,257460,257970,259520,261340,263150,265310,267370,269120,271000,272000) > par5 = 'FALSE' > par4 = '0.25' > par3 = '1' > par2 = '0' > par1 = 'FALSE' > par2 <- as.numeric(par2) > par3 <- as.numeric(par3) > par4 <- as.numeric(par4) > if (par5 == 'TRUE') par5 <- TRUE else par5 <- FALSE > xc <- x > if (par1 == 'TRUE') { + xc <- cut(x, quantile(x, probs=seq(par2, par3, par4), na.rm=par5)) + } > myt <- as.matrix(table(xc)) > myt [,1] 211940 1 212270 1 212540 1 213040 1 213780 1 213790 1 214400 1 215310 1 215520 1 216430 1 216690 1 217150 1 217630 1 218130 1 218710 1 218800 1 219360 1 219500 1 219800 1 220350 1 220560 1 221110 1 221320 1 221460 1 223550 1 225230 1 226760 1 227340 1 228340 1 228930 1 230300 1 230340 1 231270 1 231370 1 231830 1 232450 1 233060 1 233220 1 233520 1 234520 1 234860 1 234870 1 236050 1 236560 1 236980 1 238310 1 238600 1 239050 1 239690 1 240700 1 241330 1 241410 1 241580 1 241670 1 241690 1 241970 1 242030 1 242130 2 242740 1 243050 1 243320 1 243360 1 243940 1 244230 1 244260 1 244270 1 244350 1 245130 1 246740 1 247910 1 249590 1 251610 1 253430 1 255290 1 256710 1 257190 1 257460 1 257820 1 257970 1 259520 1 261340 1 263150 1 265310 1 267370 1 269120 1 271000 1 272000 1 > cmyt <- cumsum(myt) > smyt <- sum(myt) > breaks <- round((par3-par2)/par4) > postscript(file="/var/wessaorg/rcomp/tmp/1fka71411135432.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(x,breaks=breaks) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2y65f1411135432.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(cumsum(x),breaks=breaks) > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Frequency Table 1',5,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > if (par1 == 'TRUE') { + a<-table.element(a,'Intervals',header=TRUE) + } else { + a<-table.element(a,'Level',header=TRUE) + } > a<-table.element(a,'Non-cumul.',2,TRUE) > a<-table.element(a,'Cumulative',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > if (par1 == 'TRUE') { + a<-table.element(a,'Lower,Upper',header=TRUE) + } else { + a<-table.element(a,'',header=TRUE) + } > a<-table.element(a,'Abs.',1,TRUE) > a<-table.element(a,'Rel.',1,TRUE) > a<-table.element(a,'Abs.',1,TRUE) > a<-table.element(a,'Rel.',1,TRUE) > a<-table.row.end(a) > for (i in 1:length(myt)) { + a<-table.row.start(a) + a<-table.element(a,rownames(myt)[i],header=TRUE) + a<-table.element(a,myt[i]) + a<-table.element(a,round(myt[i]/smyt,4)) + a<-table.element(a,cmyt[i]) + a<-table.element(a,round(cmyt[i]/smyt,4)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/32hk91411135432.tab") > > try(system("convert tmp/1fka71411135432.ps tmp/1fka71411135432.png",intern=TRUE)) character(0) > try(system("convert tmp/2y65f1411135432.ps tmp/2y65f1411135432.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.972 0.139 1.107