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(58.58527778 + ,33.60611111 + ,49.03 + ,49.81138889 + ,34.21805556 + ,14.65166667 + ,107.0927778 + ,9.213888889 + ,28.23472222 + ,41.40583333 + ,45.95722222 + ,65.8925 + ,48.14611111 + ,36.98083333 + ,71.90916667 + ,50.02305556 + ,90.22194444 + ,64.15666667 + ,65.77361111 + ,37.63138889 + ,56.36805556 + ,59.76305556 + ,95.63805556 + ,42.75972222 + ,36.92861111 + ,48.53444444 + ,48.44861111 + ,62.65222222 + ,62.12 + ,34.67138889 + ,61.58277778 + ,58.54638889 + ,47.29611111 + ,72.37805556 + ,23.57027778 + ,81.78444444 + ,28.05861111 + ,59.90027778 + ,90.3075 + ,1.993333333 + ,46.53944444 + ,29.55777778 + ,26.82222222 + ,73.82472222 + ,74.90305556 + ,41.42 + ,48.84 + ,42.46416667 + ,31.01805556 + ,32.33555556 + ,100.6391667 + ,21.88888889 + ,50.87972222 + ,77.2125 + ,41.84138889 + ,46.89138889 + ,6.718888889 + ,91.46305556 + ,18.06361111 + ,28.0825 + ,60.81833333 + ,67.79222222 + ,94.88055556 + ,28.77694444 + ,64.81333333 + ,71.23944444 + ,57.26694444 + ,86.52027778 + ,65.5 + ,49.4275 + ,57.54888889 + ,54.59805556 + ,48.38444444 + ,39.79055556 + ,52.09972222 + ,52.13361111 + ,33.06 + ,50.60888889 + ,20.435 + ,54.16083333 + ,46.52444444 + ,39.93222222 + ,76.53916667 + ,67.55527778 + ,50.83305556 + ,37.68027778 + ,42.30527778 + ,33.39472222 + ,96.24583333 + ,40.49722222 + ,53.70527778 + ,22.48694444 + ,34.10388889 + ,36.27361111 + ,31.28083333 + ,79.57444444 + ,66.96277778 + ,41.235 + ,56.86472222 + ,50.5775 + ,38.98444444 + ,61.25444444 + ,67.51666667 + ,45.2125 + ,50.72583333 + ,64.48277778 + ,73.69944444 + ,23.77055556 + ,86.34416667 + ,62.51666667 + ,64.5325 + ,40.26833333 + ,12.02416667 + ,43.265 + ,45.7525 + ,56.09444444 + ,65.40388889 + ,61.33361111 + ,27.62944444 + ,25.73916667 + ,37.03555556 + ,17.04472222 + ,34.98055556 + ,27.98611111 + ,62.37472222 + ,22.86555556 + ,28.33611111 + ,28.20083333 + ,67.64194444 + ,6.371666667 + ,11.54611111 + ,42.35388889 + ,17.1825 + ,27.75638889 + ,36.80194444 + ,88.165 + ,5.848333333 + ,58.23361111 + ,6.291111111 + ,8.726111111 + ,12.97166667 + ,36.58277778 + ,25.48194444 + ,67.98583333 + ,51.25277778 + ,22.18416667 + ,35.67305556 + ,27.1775 + ,10.615 + ,41.9725 + ,75.68277778 + ,47.915 + ,30.01194444 + ,91.14083333 + ,69.60527778 + ,97.51861111 + ,43.89305556 + ,27.46277778 + ,23.73305556 + ,63.67833333 + ,97.67194444 + ,23.39083333 + ,33.45694444 + ,90.16611111 + ,36.40805556 + ,56.74194444 + ,45.98416667 + ,39.36722222 + ,32.23555556 + ,69.4575 + ,83.27083333 + ,54.39944444 + ,48.12777778 + ,70.69111111 + ,28.99694444 + ,37.80111111 + ,55.41 + ,25.69416667 + ,62.31388889 + ,37.71694444 + ,20.66888889 + ,22.56666667 + ,4.08 + ,50.45361111 + ,75.51555556 + ,1.999722222 + ,12.96111111 + ,4.874166667 + ,37.04666667 + ,26.45194444 + ,42.38916667 + ,27.26277778 + ,22.11638889 + ,16.44277778 + ,38.87277778 + ,32.94777778 + ,20.24444444 + ,18.1875 + ,27.67861111 + ,19.99027778 + ,21.46444444 + ,13.69138889 + ,37.53638889 + ,30.12388889 + ,24.92944444 + ,12.30444444 + ,21.56888889 + ,50.42444444 + ,37.2275 + ,34.46222222 + ,25.73055556 + ,33.84666667 + ,14.69861111 + ,22.74222222 + ,16.38361111 + ,14.86527778 + ,16.89222222 + ,15.65972222 + ,18.19166667 + ,22.48583333 + ,21.195 + ,28.89194444 + ,27.25111111 + ,18.88583333 + ,8.608055556 + ,37.62722222 + ,20.41777778 + ,17.53416667 + ,17.015 + ,20.80944444 + ,8.826111111 + ,22.62138889 + ,24.21833333 + ,13.91388889 + ,18.2625 + ,15.73694444 + ,43.99972222 + ,12.90416667 + ,20.45111111 + ,10.66527778 + ,25.5275 + ,38.75722222 + ,14.49 + ,14.32416667 + ,19.5975 + ,23.57111111 + ,28.48277778 + ,24.07722222 + ,23.80805556 + ,9.628333333 + ,41.82777778 + ,27.66972222 + ,5.374722222 + ,27.60361111 + ,23.95277778 + ,8.565833333 + ,8.807222222 + ,24.94611111 + ,17.24666667 + ,11.15305556 + ,7.676111111 + ,21.38611111 + ,10.40555556 + ,15.04361111 + ,13.85055556 + ,23.42694444 + ,17.82638889 + ,16.495 + ,33.14111111 + ,21.30611111 + ,28.72916667 + ,19.54 + ,12.05833333 + ,29.12166667 + ,17.28194444 + ,19.25111111 + ,14.75472222 + ,5.49 + ,24.07777778 + ,23.3625 + ,21.65138889 + ,24.75361111 + ,25.27916667 + ,11.18 + ,17.82972222 + ,14.12694444 + ,15.72583333 + ,17.44222222 + ,20.14861111) > par4 = 'Unknown' > par3 = 'FALSE' > par2 = 'grey' > par1 = '' > xlab = 'x' > main = 'Histogram' > par4 <- 'Unknown' > par3 <- 'FALSE' > par2 <- 'grey' > 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/fisher/rcomp/tmp/12v3t1355594250.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab + load(file="/var/fisher/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/fisher/rcomp/tmp/2cmtb1355594250.tab") + } else { + mytab + reltab <- mytab / sum(mytab) + n <- length(mytab) + + #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab + load(file="/var/fisher/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/fisher/rcomp/tmp/3f5yc1355594250.tab") + } > > try(system("convert tmp/12v3t1355594250.ps tmp/12v3t1355594250.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.943 0.244 1.167