R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-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(9.877 + ,366.039 + ,419.143 + ,427.905 + ,501.518 + ,739.59 + ,783.497 + ,800.607 + ,801.108 + ,860.167 + ,940.289 + ,995.236 + ,996.838 + ,1025.529 + ,1035.326 + ,1083.42 + ,1194.72 + ,1204.083 + ,1257.839 + ,1305.391 + ,1309.826 + ,1320.579 + ,1382.331 + ,1405.615 + ,1434.516 + ,1526.671 + ,1578.684 + ,1632.267 + ,1696.234 + ,1729.52 + ,1772.581 + ,1774.579 + ,1856.344 + ,1902.466 + ,1979.525 + ,1991.965 + ,2230.159 + ,2247.297 + ,2267.026 + ,2292.01 + ,2292.278 + ,2369.351 + ,2400.296 + ,2512.111 + ,2568.291 + ,2676.632 + ,2701.316 + ,2727.441 + ,2848.67 + ,2900.615 + ,2953.187 + ,3051.192 + ,3229.79 + ,3290.98 + ,3354.077 + ,3752.025 + ,3896.176 + ,3932.587 + ,3969.586 + ,4291.648 + ,4340.245 + ,4572.873 + ,4579.963 + ,4648.801 + ,4725.585 + ,4852.104 + ,4900.06 + ,4955.072 + ,5021.405 + ,5172.593 + ,5185.719 + ,5248.463 + ,5336.012 + ,5404.867 + ,5596.047 + ,5942.952 + ,6055.384 + ,6313.989 + ,6636.357 + ,6642.545 + ,6676.467 + ,6964.026 + ,7109.219 + ,7211.087 + ,7386.55 + ,7496.07 + ,7745.115 + ,7774.204 + ,7985.211 + ,7990.4 + ,8015.194 + ,8015.525 + ,8727.758 + ,8750.61 + ,8996.103 + ,9049.184 + ,9131.789 + ,9382.888 + ,9716.912 + ,9917.963 + ,10588.346 + ,10599.639 + ,10818.928 + ,11117.894 + ,11191.645 + ,11255.839 + ,11301.699 + ,11327.33 + ,11342.183 + ,11638.818 + ,11762.594 + ,12164.469 + ,12363.141 + ,12622.35 + ,12633.151 + ,12816.683 + ,13389.071 + ,13404.741 + ,13488.734 + ,14046.596 + ,14274.844 + ,14392.045 + ,14447.835 + ,14806.503 + ,14850.309 + ,15143.559 + ,15258.171 + ,15489.266 + ,15626.999 + ,15901.515 + ,16270.493 + ,16370.634 + ,16526.998 + ,18279.577 + ,18431.239 + ,18949.059 + ,19588.612 + ,19652.141 + ,19705.722 + ,21535.745 + ,22000.113 + ,22699.933 + ,23960.68 + ,24589.337 + ,24870.627 + ,26074.393 + ,27642.99 + ,28076.145 + ,28225.332 + ,29743.507 + ,30037.405 + ,30041.815 + ,30566.317 + ,31052.639 + ,31293.891 + ,31865.489 + ,32588.615 + ,35257.712 + ,35333.269 + ,35967.974 + ,36369.799 + ,37101.771 + ,37145.878 + ,37191.617 + ,37941.408 + ,38049.884 + ,38532.16 + ,39318.483 + ,39460.31 + ,39770.684 + ,40604.925 + ,40681.235 + ,40847.188 + ,41091.324 + ,44759.545 + ,46421.093 + ,48918.412 + ,50513.53 + ,53399.867 + ,55893.043 + ,80724.846 + ,98337.052) > par4 = 'Unknown' > par3 = 'FALSE' > par2 = 'red' > par1 = '30' > xlab = 'GDP Per Capita (International Dollars)' > main = 'World GDP Per Capita Distribution 2011' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > par1 <- as.numeric(par1) > if (par3 == 'TRUE') par3 <- TRUE > if (par3 == 'FALSE') par3 <- FALSE > if (par4 == 'Unknown') par1 <- as.numeric(par1) > if (par4 == 'Interval/Ratio') par1 <- as.numeric(par1) > if (par4 == '3-point Likert') par1 <- c(1:3 - 0.5, 3.5) > if (par4 == '4-point Likert') par1 <- c(1:4 - 0.5, 4.5) > if (par4 == '5-point Likert') par1 <- c(1:5 - 0.5, 5.5) > if (par4 == '6-point Likert') par1 <- c(1:6 - 0.5, 6.5) > if (par4 == '7-point Likert') par1 <- c(1:7 - 0.5, 7.5) > if (par4 == '8-point Likert') par1 <- c(1:8 - 0.5, 8.5) > if (par4 == '9-point Likert') par1 <- c(1:9 - 0.5, 9.5) > if (par4 == '10-point Likert') par1 <- c(1:10 - 0.5, 10.5) > postscript(file="/var/wessaorg/rcomp/tmp/10dj61318731539.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if(is.numeric(x[1])) { + if (is.na(par1)) { + myhist<-hist(x,col=par2,main=main,xlab=xlab,right=par3) + } else { + if (par1 < 0) par1 <- 3 + if (par1 > 50) par1 <- 50 + myhist<-hist(x,breaks=par1,col=par2,main=main,xlab=xlab,right=par3) + } + } else { + plot(mytab <- table(x),col=par2,main='Frequency Plot',xlab=xlab,ylab='Absolute Frequency') + } > dev.off() null device 1 > if(is.numeric(x[1])) { + myhist + n <- length(x) + + #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,hyperlink('http://www.xycoon.com/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 + if (par3 == FALSE) mybracket <- '[' else mybracket <- ']' + mynumrows <- (length(myhist$breaks)-1) + for (i in 1:mynumrows) { + a<-table.row.start(a) + if (i == 1) + dum <- paste('[',myhist$breaks[i],sep='') + else + dum <- paste(mybracket,myhist$breaks[i],sep='') + dum <- paste(dum,myhist$breaks[i+1],sep=',') + if (i==mynumrows) + dum <- paste(dum,']',sep='') + else + dum <- paste(dum,mybracket,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="/var/wessaorg/rcomp/tmp/2h0n61318731539.tab") + } else { + mytab + reltab <- mytab / sum(mytab) + n <- length(mytab) + + #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 (Categorical Data)',3,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Category',header=TRUE) + a<-table.element(a,'Abs. Frequency',header=TRUE) + a<-table.element(a,'Rel. Frequency',header=TRUE) + a<-table.row.end(a) + for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,labels(mytab)$x[i],header=TRUE) + a<-table.element(a,mytab[i]) + a<-table.element(a,round(reltab[i],4)) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/3re3u1318731539.tab") + } > > try(system("convert tmp/10dj61318731539.ps tmp/10dj61318731539.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.581 0.069 0.670