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(60.105502136752000 + ,7.907312589228700 + ,-1.629491887131730 + ,-1.523957559467700 + ,-1.566427606620550 + ,-3.789554566451050 + ,54.200457074549000 + ,-32.163510672247400 + ,-30.402014378527600 + ,33.723646041332600 + ,-53.295571899362000 + ,-14.104598762058100 + ,7.823650371650560 + ,-23.492157461915400 + ,-39.202849795559900 + ,-54.438726552717300 + ,-63.160118106051600 + ,-14.485513312119400 + ,-6.628558771563010 + ,-37.251050153206200 + ,7.170462889295040 + ,-12.467581386629100 + ,23.642668315511900 + ,-1.088791886433090 + ,-51.662325993329800 + ,-35.512251522296000 + ,5.730258768588780 + ,-4.402113954364150 + ,-19.401440515526700 + ,1.520637597479090 + ,20.301634328476600 + ,21.129552578314700 + ,32.299041793952500 + ,25.405520281557300 + ,16.249817632919000 + ,-24.017154073341100 + ,-24.781620945858200 + ,-15.622858322169500 + ,-11.764952702771900 + ,15.385614471917900 + ,-5.431603723902270 + ,-13.878589038249800 + ,24.544117388533300 + ,28.999963471410300 + ,1.823381546043520 + ,9.408070370187970 + ,3.027664330040980 + ,-4.924275934007740 + ,-9.914609211208590 + ,-41.194180801578900 + ,4.537200239685570 + ,23.270218164366300 + ,-20.074935132256200 + ,-20.509042121904400 + ,10.759626115194600 + ,24.269471838984300 + ,35.926564997673600 + ,32.318324426507600 + ,37.872923673265400 + ,36.110268543315900 + ,50.367586366732600 + ,19.674537875964500 + ,10.769621706194800 + ,-6.487800001055580 + ,-27.566236037334000 + ,-51.733367569934800 + ,-6.992290362617900 + ,8.946225886097070 + ,8.880187826561670 + ,-23.810509488063200 + ,-0.278862805984659 + ,-15.453298389024400 + ,-10.467075471290800 + ,-30.767386022286500 + ,-18.473160300275400 + ,8.491499309968790 + ,-40.768910811535500 + ,-21.233091409774700 + ,-22.881542105592100 + ,22.788332257880100 + ,3.887467604892780 + ,34.557110225165300 + ,16.986140456027500 + ,10.877064554075900 + ,-23.973069195609600 + ,-13.365480154239200 + ,12.485438612906300 + ,-15.173816735979200 + ,21.213182978857300 + ,0.785421269382084 + ,-19.008182699649100 + ,-25.508856180444900 + ,-0.0938131575134094 + ,16.888358118621200 + ,43.708864849606400 + ,14.542044173700200 + ,-11.240111835232900 + ,-29.369195516860100 + ,-20.598685634972600 + ,4.577397673602040 + ,11.029760211128600 + ,14.736685076468700 + ,-23.531866174978400 + ,-4.921531948129910 + ,15.326629227714100 + ,29.089261351332600 + ,54.294590941540900 + ,31.116771502448300 + ,48.848504485926100 + ,50.654788833335300 + ,6.259586476791070 + ,0.125927575354126 + ,-29.312377188536800 + ,-14.212774692833500 + ,-16.321899968516800 + ,-34.789232971974500 + ,-53.298800682701200 + ,-14.123472139651600 + ,-19.904078112981600 + ,34.583810001181300 + ,-2.725432412863600 + ,-14.154123473298900 + ,-30.486335606010300 + ,-56.722391646765900 + ,-17.097567198469700 + ,6.781804301078700 + ,-4.199191314862560 + ,5.918149190913310 + ,5.256021609625350 + ,29.797534213448200 + ,28.099060232233400 + ,-5.180180836364630 + ,-0.79512116752386 + ,-34.218142247410400 + ,41.416164263170000 + ,-24.533730369838100 + ,-19.730557989372600 + ,35.128077583754800 + ,-13.576465130286600 + ,8.648082866597060 + ,-21.862534337184900 + ,39.644586972684100 + ,30.126766094770500 + ,59.366912136556700 + ,28.053251004387100 + ,21.594556562382100 + ,-23.984953845749900 + ,-29.909150799627300 + ,-27.276039391603000 + ,4.602911543302070 + ,-22.207181163616600 + ,-34.743739592739000 + ,-26.164702208665500 + ,-10.142329515027000 + ,-8.798035530515340 + ,13.884425824100000 + ,4.869115945923970 + ,-17.876809417712400 + ,-4.530999113435310 + ,-8.675883254860650 + ,14.553069972311400 + ,-25.444493179183200 + ,-18.503746337647300 + ,28.668939513433700 + ,-12.842768894583700 + ,-12.673935863073800 + ,35.065571570143000 + ,10.491911074333600 + ,34.799821814800400 + ,26.382577058530900 + ,-31.450295578912300 + ,-13.350010123360100 + ,-4.946762703076560 + ,10.214763212881500 + ,-20.151738608344600 + ,-21.200384154203700 + ,-3.841962139071430 + ,2.477180829386330 + ,26.117511976917100 + ,1.306201075903630 + ,15.976349059390100 + ,-4.291690398502170 + ,-5.682394150977980 + ,-5.665764693693010 + ,-30.332498938452400 + ,38.729733363233400 + ,-47.837997290189000 + ,3.321940198286310 + ,-2.614714534767530 + ,3.499491319785020 + ,-10.994735054654900 + ,18.505687742399500 + ,-1.727214314555110 + ,27.734506649469200 + ,-23.843594079094500 + ,12.456713506740500 + ,-20.970587319696400 + ,22.355040813270000 + ,-21.669053506196000 + ,-14.584150283879600 + ,-6.948261888214180 + ,-3.844300734941500 + ,-2.592175220424280 + ,-2.606079633912260 + ,-7.148573088618780 + ,-11.133931876000000 + ,18.463790548064300 + ,10.431606141974300 + ,20.111394906474100 + ,17.585817125854700 + ,-7.287709889268740 + ,-10.719794800931300 + ,-7.889017955932450 + ,4.236220472917470 + ,-9.492926941993910 + ,14.098999815588100 + ,-2.340445580023980 + ,3.813803754024780 + ,2.058393512826170 + ,4.052997857020270 + ,-10.844862137151400 + ,50.853012324373200 + ,15.264595051509300 + ,-18.231512532723900 + ,14.857709931226600 + ,10.891750422069800 + ,-27.684531433388500 + ,-22.296902373437300 + ,-20.448256250686300 + ,19.049784411625500 + ,-9.460636400293250 + ,-13.032621337357300 + ,-8.549005941186380 + ,57.140945046846900 + ,19.424142212143000 + ,-26.830983001473100 + ,-2.375789422791060 + ,-4.841984245517270 + ,-10.430343313100500 + ,-16.685597270849800 + ,-8.535389246669300 + ,-1.011460964061370 + ,11.530320435740700 + ,13.995248188981200 + ,-12.322825473095300 + ,24.042058033293400 + ,39.967059599686800 + ,-4.531480962211790 + ,20.790634404711600 + ,-6.631809056570660 + ,-32.683088525343700 + ,-13.213953207478000 + ,21.010630015082000 + ,32.219715891287000 + ,19.962339504755600 + ,10.717014437494100 + ,-7.987055178677400 + ,32.442592185996000 + ,36.686806257020900 + ,-3.434985112567400 + ,8.795770356075250 + ,-2.177042793156260 + ,12.913345730458800 + ,-7.731531394291040 + ,7.113072823366450 + ,-16.182569088679300 + ,-11.520070591136300 + ,-26.205387268549100 + ,-25.197282316299900 + ,5.070944864413150 + ,33.521277765799400 + ,5.463100604888840 + ,-19.948599258901500 + ,-25.529699094909000 + ,1.531601015557840 + ,-16.267856568258900 + ,6.819238576668340 + ,-13.621948325961600 + ,0.640501844928622 + ,-21.438419523167100 + ,-25.586377618623900 + ,3.756990400816330 + ,24.516643860920200 + ,8.509497665653100 + ,-8.870562774209470 + ,-10.818104143248300 + ,-41.879148728358900 + ,-16.889160341708500 + ,-9.794453731080470 + ,14.500002323189400 + ,-5.710688022182180 + ,4.477170448968650 + ,-19.497295919848100 + ,0.746187934154989 + ,20.624401595029300 + ,11.721153781144800 + ,13.531505025554600 + ,-26.309844364410300 + ,13.476158699179900 + ,2.534010682220700 + ,29.753080445948200 + ,9.046961144409860 + ,-12.287076964116900 + ,-12.523129418815900 + ,1.327508167207160 + ,16.347057213377300 + ,33.449424050193600 + ,6.395776893376880 + ,43.777257340183200 + ,1.295681207232460 + ,38.135431520262000 + ,39.459479737038400 + ,131.183597606530000 + ,7.175545616393490 + ,15.292626067378000 + ,-37.518684587387300 + ,-26.973262898070600 + ,-35.786051835778500 + ,-14.023070258689400 + ,-20.981771362873500 + ,-23.408807568463500 + ,-18.877586017302100 + ,-38.708702989784300 + ,-15.783276729274200 + ,5.956315671720860 + ,-7.058043321348120 + ,-29.814249740754300 + ,-29.324599906597200 + ,-50.016753181472600 + ,20.360623535237100 + ,33.106532569123400 + ,23.529990999874700 + ,-20.732569468258800 + ,-2.546910809680410 + ,0.94132987310752 + ,-12.591330063730200 + ,-7.624749328039910 + ,38.257466963522000 + ,-22.406062405960700 + ,-61.804184623424200 + ,-30.868578939543700 + ,10.934468801689900 + ,-10.126286331900500 + ,31.925762581573300 + ,-10.207648081455900 + ,-1.090251191291600 + ,-8.301356733144980 + ,-45.956006137348100 + ,13.524671856492900 + ,-1.020698593768880 + ,18.509844184136300 + ,-24.784269672428800 + ,-7.760453189621440 + ,-32.817236164421200 + ,54.038726371657500 + ,3.627317145533770 + ,13.025417693240100 + ,-9.993761806170820 + ,-2.366689948430460 + ,17.782239152593700) > 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/165cr1355324971.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/2zyzl1355324971.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/3ty1v1355324971.tab") + } > > try(system("convert tmp/165cr1355324971.ps tmp/165cr1355324971.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.981 0.223 1.191