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(50.4687229 + ,80.82533683 + ,46.11492629 + ,59.11183295 + ,72.57189979 + ,59.18400135 + ,71.06095624 + ,65.38152563 + ,59.06958692 + ,66.20129867 + ,64.6858986 + ,72.99797532 + ,60.71624982 + ,68.0568725 + ,42.09837031 + ,56.82115686 + ,47.58671609 + ,51.96638782 + ,71.44862836 + ,70.18029252 + ,72.87608029 + ,67.17250259 + ,67.32770786 + ,58.66613507 + ,58.14931471 + ,63.95264124 + ,55.63866595 + ,49.66304702 + ,70.27449343 + ,63.95677944 + ,76.92992555 + ,50.09332896 + ,74.06788215 + ,72.53151822 + ,61.36475364 + ,54.81988198 + ,76.63588591 + ,62.71780891 + ,59.3726874 + ,74.96728146 + ,51.1909299 + ,62.24285941 + ,51.90497419 + ,57.82769464 + ,60.81138296 + ,64.81263669 + ,46.29716629 + ,64.36722303 + ,82.22550393 + ,44.18275027 + ,62.13708518 + ,70.71637143 + ,67.0072474 + ,60.61504579 + ,58.48374728 + ,65.47104264 + ,57.33533969 + ,67.10439281 + ,50.60519258 + ,60.46795776 + ,72.09243692 + ,63.17402282 + ,52.75707978 + ,57.13026 + ,48.45360096 + ,57.51405539 + ,56.96485702 + ,64.44140369 + ,63.21266498 + ,53.39395345 + ,59.42939439 + ,52.74016318 + ,75.54781193 + ,63.56022838 + ,56.23114491 + ,59.68363227 + ,63.16115347 + ,83.27105904 + ,71.85585461 + ,67.79816673 + ,52.05899712 + ,58.53171175 + ,75.44358383 + ,50.09583007 + ,46.05449036 + ,71.43243935 + ,57.17168748 + ,37.94311639 + ,62.46701575 + ,44.37488102 + ,67.3127012 + ,64.26477982 + ,59.76398612 + ,51.54076704 + ,68.66564278 + ,58.09325573 + ,69.39005531 + ,63.04396508 + ,58.98579972 + ,48.70616764 + ,59.93229949 + ,74.1465307 + ,62.18641389 + ,65.70894372 + ,63.64593689 + ,56.21225015 + ,77.00091161 + ,70.11756012 + ,72.3081918 + ,65.06672677 + ,65.57707835 + ,47.85015123 + ,70.24473022 + ,58.38229314 + ,79.52794264 + ,72.24157131 + ,65.7116381 + ,60.64035248 + ,65.81821951 + ,54.76731318 + ,59.41330771 + ,59.22928282 + ,62.45281626 + ,57.18284016 + ,60.30947831 + ,45.11430022 + ,70.24473022 + ,88.43953553 + ,47.27662387 + ,61.80945108 + ,78.78115654 + ,57.17886112 + ,64.57773695 + ,60.65950871 + ,54.70405783 + ,49.32157723 + ,53.39204351 + ,47.40954652 + ,49.20588951 + ,56.45851858 + ,76.55103006 + ,51.25839167 + ,63.56267265 + ,65.58511601 + ,80.29364623 + ,38.56139089 + ,37.31792973 + ,55.7360501 + ,42.23347575 + ,62.58232831 + ,55.28505441 + ,50.05201516 + ,60.16179911 + ,69.16070348 + ,58.13919658 + ,63.74175215 + ,55.76535856 + ,55.62771791 + ,55.08490873 + ,59.70582394 + ,44.22799763 + ,51.16271283 + ,56.72202193 + ,55.31069079 + ,68.60566161 + ,57.29726596 + ,72.20605554 + ,75.10943548 + ,67.24887741 + ,50.66803866 + ,55.12801878 + ,45.47073119 + ,76.89477358 + ,54.25049282 + ,60.30336196 + ,54.4675551 + ,66.14852524 + ,44.90011421 + ,63.87748287 + ,75.95508365 + ,76.89477358 + ,63.32159971 + ,70.49220373 + ,69.96933522 + ,51.29531716 + ,70.21116987 + ,54.80675115 + ,61.18196795 + ,71.59271505 + ,59.77239895 + ,75.34849616 + ,75.00725375 + ,69.59289537 + ,54.91760718 + ,57.6282993 + ,76.15489964 + ,44.17738425 + ,53.37205736 + ,57.88874447 + ,50.36945155) > 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/1lje71355326246.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/2psqd1355326246.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/32vf31355326246.tab") + } > > try(system("convert tmp/1lje71355326246.ps tmp/1lje71355326246.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.900 0.235 1.114