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(-2.8383455253 + ,-6.8876476771 + ,-7.4106697959 + ,21.5609086781 + ,-14.7163972633 + ,-8.9731065875 + ,-21.3856911445 + ,-12.92515467 + ,29.2447935282 + ,3.2344204049 + ,-35.2373838504 + ,-27.1792379163 + ,5.6337793547 + ,-17.4188046701 + ,1.57717113 + ,14.7492731318 + ,-8.6464544896 + ,-28.2505458756 + ,11.8466034378 + ,-4.2815086526 + ,-19.5294728073 + ,-9.7870674112 + ,3.9260353751 + ,-10.6842063204 + ,5.2482378668 + ,-8.2496164978 + ,11.8185907956 + ,13.5347210251 + ,-8.3055882213 + ,-11.4457118176 + ,-29.7146224435 + ,-2.9525507815 + ,11.8343015352 + ,-14.580699983 + ,17.468430382 + ,-18.3658451479 + ,-12.4496913271 + ,14.4134668292 + ,14.7736363482 + ,28.5434853104 + ,5.6047909046 + ,-20.0055017819 + ,-11.8235293595 + ,13.2232096387 + ,42.9217520606 + ,15.1990682348 + ,5.4721970806 + ,-1.235261552 + ,6.2473801417 + ,2.6208358575 + ,-4.731176187 + ,34.2228181964 + ,-15.9938460107 + ,13.4948790191 + ,8.5358919008 + ,-38.9718418159 + ,9.3537516169 + ,-0.9476791512 + ,29.4611346487 + ,-20.0530302742 + ,5.187887602 + ,1.0711050037 + ,15.2581910924 + ,10.1549289227 + ,-24.470923332 + ,27.0065923012 + ,7.1923091618 + ,13.2445018346 + ,12.1883858068 + ,-29.4688903527 + ,6.8485379664 + ,15.2470262084 + ,18.1806960883 + ,18.6627589331 + ,15.5690757884 + ,-3.8188078036 + ,13.4365678512 + ,-10.7144988358 + ,17.2186220641 + ,1.8802105698 + ,24.7921510147 + ,-13.5084923467 + ,23.966532712 + ,26.9724458943 + ,11.1740372181 + ,-2.4950325527 + ,-21.2665295414 + ,-13.0130569535 + ,10.579067621 + ,-15.5669323549 + ,0.7161494212 + ,26.6346510236 + ,3.7208761669 + ,-27.9710694652 + ,-0.0648377608 + ,-9.1023753862 + ,-14.1195227024 + ,-0.9888045718 + ,23.994963672 + ,6.1141151687 + ,18.8590831063 + ,-6.2679218578 + ,33.654771004 + ,-11.8338248695 + ,-66.1273159327 + ,-14.8034081555 + ,4.7257859336 + ,35.0184266599 + ,41.5978086796 + ,-50.0753579077 + ,-50.4927006049 + ,-44.4856366272 + ,0.0336439267 + ,-5.0427554882 + ,9.8664792844 + ,-30.5456405658 + ,30.510595308 + ,32.9930138008 + ,4.9380784794 + ,-17.486826193 + ,-29.1683681672 + ,2.5726588033 + ,15.9187027322 + ,-7.4464242839 + ,-37.0097494808 + ,12.1802755329 + ,-24.857269276 + ,0.8353015574 + ,8.7395262687 + ,37.1026630382 + ,-28.3412120096 + ,28.0745111985 + ,-4.4937418387 + ,6.7722682701 + ,17.3390204789 + ,-1.9768117774 + ,-4.7802133527 + ,-9.6924338679 + ,5.2322440793 + ,-6.1785460882 + ,14.5541593128 + ,9.4626062006 + ,-7.1795635107 + ,23.139950353 + ,-15.3692470207 + ,0.6380593989 + ,-0.1913211067 + ,8.393052097 + ,-2.7043425142 + ,19.3025817229 + ,11.8590522423 + ,13.737435535 + ,-32.976809998 + ,8.9321765586 + ,-23.4072121248 + ,29.1797829312 + ,-6.4315902457 + ,-33.6187541773 + ,-12.7532638124 + ,17.900629555 + ,-28.6638737224 + ,-7.9134852185 + ,0.5440465541 + ,1.5308076778 + ,-9.9445935911 + ,24.2138934862 + ,34.2585254263 + ,-21.6496089751 + ,21.8993054602 + ,-64.3898034075 + ,3.8566750666 + ,22.0351854485 + ,-41.4050648243 + ,-28.600778474 + ,-1.7926413646 + ,-23.0791094171 + ,44.2911962949 + ,-34.4859128744 + ,15.9985201915 + ,-13.0489016616 + ,24.6440844032 + ,8.4955651609 + ,23.7684747276 + ,2.5890443113 + ,27.7934097507 + ,4.4967994243 + ,5.171841539 + ,-46.4502832315 + ,-1.0057205665 + ,-21.0381984609 + ,0.9399927234 + ,13.5110981027 + ,12.6978693833 + ,19.9779995145 + ,30.217075069 + ,-23.2973535559 + ,-37.1214968815 + ,-1.3331763845 + ,8.6701470333 + ,-17.857403047 + ,1.1282704284 + ,17.2453755416 + ,21.0867167816 + ,2.929145428 + ,6.8033064931 + ,-32.4708151229 + ,19.3329284734 + ,43.7845158826 + ,-23.5864717383 + ,-31.6624837326 + ,5.1618724628 + ,-7.5894285805 + ,-46.6677640237 + ,-6.4590214655 + ,8.6433795337 + ,27.5144187137 + ,2.7080226974 + ,-0.8711790688 + ,-38.3967541283 + ,-40.8912582438 + ,24.0155339282 + ,110.9616414718 + ,5.9051934629 + ,-36.6386140834 + ,-21.0086524619 + ,-21.8505511409 + ,52.5971924268 + ,19.3857309698 + ,33.592904279 + ,1.0945412587 + ,5.8081517202 + ,-12.6016245649 + ,48.2523678578 + ,-45.1149045784 + ,-19.4985759372 + ,26.0414455706 + ,-24.6417039855 + ,-40.4089848418 + ,36.0058194456 + ,1.6296105786 + ,-7.7212461123 + ,-10.7484313744 + ,12.9541166185 + ,-12.8221559942 + ,48.5900401558 + ,-37.6556594764 + ,-9.9746259919 + ,7.5428874735 + ,23.8640277893 + ,18.2360952313 + ,49.0302087067 + ,-12.020615523 + ,-38.1531654177 + ,37.8849583281 + ,-36.9571423385 + ,-18.5873987221 + ,-18.2247924757 + ,7.7544651181 + ,0.3562041314 + ,-11.0810827941 + ,36.1855810186 + ,-17.1381672207 + ,-14.1659765118 + ,-13.647508575 + ,-24.1415952183 + ,4.538750917 + ,12.2560450727 + ,2.144174854 + ,-6.6478122338) > par4 = 'Interval/Ratio' > par3 = 'FALSE' > par2 = 'grey' > par1 = '' > xlab = 'residuals' > main = 'Histogram' > par4 <- 'Interval/Ratio' > 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/1c9h71355751614.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/2m5oa1355751614.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/37gtk1355751614.tab") + } > > try(system("convert tmp/1c9h71355751614.ps tmp/1c9h71355751614.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.050 0.262 1.288