R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(-0.022233741935946 + ,-0.0337049618302789 + ,0.0483091173022536 + ,-0.0328230112698192 + ,-0.00129211833139745 + ,0.0493110612449295 + ,0.0546224665122492 + ,-0.117861816687168 + ,0.0964634691039859 + ,-0.057206691269101 + ,0.0169055095472312 + ,0.000418453742588826 + ,-0.0332118403822401 + ,0.0549981998657286 + ,0.0127322326541685 + ,0.0610913283233975 + ,-0.0019111424907391 + ,0.0429458684670947 + ,0.0883744311870188 + ,-0.0253372305781694 + ,0.0442751936347496 + ,-0.0498065743387287 + ,-0.115577586197062 + ,0.0482822007571424 + ,-0.0269254394285212 + ,0.0417421106977919 + ,0.121288318284434 + ,0.0506920605675248 + ,-0.0452100830718099 + ,0.0262370611392832 + ,-0.114723096048744 + ,-0.0508642347280115 + ,0.0633687372187966 + ,-0.0541211052632598 + ,0.0407749763734133 + ,-0.0941128595786898 + ,0.015435653543991 + ,-0.055324663916535 + ,-0.00950078905111242 + ,-0.0107386844092742 + ,0.0648371464786483 + ,0.11783327215929 + ,-0.0699628235512219 + ,-0.0169086371785917 + ,0.0125207069884029 + ,-0.117606708120584 + ,-0.12614630195538 + ,-0.0120468227653684 + ,0.101403460910754 + ,0.0406400849913568 + ,-0.0998269376329929 + ,-0.0840652332813605 + ,0.067433385830686 + ,-0.0265257998508688 + ,-0.132208402109275 + ,-0.0634075932392397 + ,-0.074637185996262 + ,0.00439331775862862 + ,0.0714154313280112 + ,-0.00840885782343924 + ,-0.0197141074033701 + ,-0.0151630828547778 + ,0.0023018283282845 + ,0.0626848114865405 + ,-0.0375980238509903 + ,-0.00672354088742954 + ,-0.0634845532183547 + ,0.0080777000853584 + ,0.0532357321344355 + ,0.156246992095981 + ,0.00428156239990805 + ,-0.0907271168789632 + ,0.0149871900305455 + ,-0.0654535629443536 + ,-0.0436503883976878 + ,0.114006133819454 + ,-0.0464039946737136 + ,0.163564705337558 + ,0.196650273011862 + ,-0.0365294743495848 + ,0.0551816376522701 + ,0.0193293408632397 + ,-0.00119475807828245 + ,0.13824857305317 + ,0.0326052113167632 + ,0.0345141739983188 + ,0.163559451703034 + ,0.0519730070697135 + ,-0.0978115986661146 + ,-0.0343292816406266 + ,0.021378350032612 + ,-0.066554633721728 + ,0.0439363847934594 + ,-0.0372268476233024 + ,0.129504606838199 + ,-0.0475261499399805 + ,-0.0252802111384205 + ,-0.0255631547951124 + ,0.0621350132274366 + ,-0.00616652765913827 + ,-0.036725766927999 + ,0.0146705008550498 + ,0.122403575135419 + ,0.0190496624176541 + ,0.0194296827557652 + ,-0.0830623797931113 + ,-0.0579912101991109 + ,-0.0912263140235452 + ,-0.066820349773012 + ,0.0570150520255438 + ,0.105734369136635 + ,-0.0731390574093828 + ,0.163256913206732 + ,-0.0919587164866352 + ,0.0533918381211822 + ,-0.032307594418593 + ,0.101959726283765 + ,0.126263056913576 + ,-0.0253694810886072 + ,-0.00381195416068994) > par4 = 'Unknown' > par3 = 'FALSE' > par2 = 'yellow' > par1 = '' > xlab = 'x' > main = 'Histogram' > par4 <- 'Unknown' > par3 <- 'FALSE' > par2 <- 'yellow' > par1 <- '' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Histogram (v1.0.12) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_histogram.wasp/ > #Source of accompanying publication: > # > 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/1xcf31355387551.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/2iw1u1355387551.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/3ej7p1355387551.tab") + } > > try(system("convert tmp/1xcf31355387551.ps tmp/1xcf31355387551.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.856 0.143 0.988