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(-20.2709054693811 + ,13.099061185656 + ,16.9335347772804 + ,29.0528022979499 + ,7.38820069498436 + ,-29.5579220471488 + ,-10.1072501563793 + ,-0.152685277280995 + ,-4.63682018394169 + ,-26.7451626861207 + ,-26.3664036644236 + ,-23.7263688810099 + ,-29.8026955707136 + ,-6.2103351910481 + ,-7.45346787479525 + ,6.32431133421221 + ,36.2182214195845 + ,-4.15831557890209 + ,48.1619420555141 + ,27.4568565571639 + ,3.81307127305456 + ,32.3652568508687 + ,-13.695456047441 + ,0.97126578235617 + ,28.921626139036 + ,44.0917816357488 + ,29.3264440690489 + ,16.9266856701619 + ,10.7430581476398 + ,-17.8149965758874 + ,-3.1762566665119 + ,-25.4760790055699 + ,-3.81460113038702 + ,-16.5390041440843 + ,6.82369436609457 + ,22.0471789340961 + ,-14.5456979710198 + ,-26.4431998412664 + ,-16.5761947749258 + ,-10.56187802827 + ,-1.2314304052494 + ,-34.3455108424754 + ,-14.1627966467986 + ,-7.16529477653486 + ,20.3935073079699 + ,24.6081411075147 + ,28.1098764309357 + ,8.19722256077625 + ,-16.6317927825005 + ,-15.8886322165168 + ,-24.9809647139458 + ,-0.0236209593056742 + ,17.7498536716993 + ,-27.8076294282984 + ,2.43168210460689 + ,19.3204217082976 + ,19.8704615262295 + ,13.5311094314512 + ,5.87885886054912 + ,2.47915020921315 + ,-7.83691991524017 + ,-30.811526703561 + ,-18.4216265552946 + ,14.3138791332485 + ,12.2655156981566 + ,-47.297438552061 + ,-33.1635981693756 + ,-35.2509910252572 + ,-20.8770836668977 + ,-27.8773523556143 + ,-23.1905195204548 + ,-8.87481040621282 + ,19.9245372349118 + ,37.0115920518963 + ,49.4631538054682 + ,59.2627556852162 + ,50.978488441329 + ,-22.4425976560265 + ,-2.86688912047919 + ,11.175673701868 + ,28.3795367384563 + ,0.425431908522626 + ,3.95842860246518 + ,-0.59489764540632 + ,0.935414633604864 + ,-9.63816180253048 + ,-5.24723130207843 + ,28.0306828375036 + ,9.22472785345053 + ,-37.6788163349869 + ,-32.4855658905216 + ,-9.77669919251173 + ,-8.3065322802608 + ,3.68365775668389 + ,8.76094931750475 + ,12.6795480067219 + ,-13.9182147771784 + ,-20.6353499582819 + ,2.51202179720195 + ,4.34118050159435 + ,35.1864700823514 + ,1.25552598858462 + ,5.32137652772064 + ,-13.9388609745915 + ,-14.9377982626625 + ,-15.6073653433434 + ,15.2101690998517 + ,20.4543466175311 + ,3.68216266209305 + ,-17.6808173004925 + ,-21.0792903264907 + ,-3.00272537180729 + ,16.9899704592409 + ,-12.2492128493627 + ,-24.3916015250635 + ,-38.2721164195545 + ,-36.7913310998044 + ,-43.6359683026841 + ,-17.9935039816878 + ,-19.5283807502867 + ,1.12038100799691 + ,39.9251486795142 + ,49.5944232876187 + ,69.8198141935435 + ,57.5613359758332 + ,22.1695891824235 + ,30.6746370219168 + ,18.2882112206891 + ,-13.9369143662975 + ,-18.2928367928593 + ,-25.8616576955449 + ,12.6004798864657 + ,13.2462559953589 + ,16.2652960058122 + ,9.44884295285294 + ,-18.3011186066836 + ,-13.5349492898555 + ,-35.7922295810592 + ,-25.3527152393601 + ,-16.5313537597499 + ,-11.1486920658987 + ,8.68204031415814 + ,27.8998742180912 + ,13.0389596374505 + ,-1.03831641630757 + ,-34.8015338446592 + ,14.6997556635764 + ,-3.58926916477731 + ,-7.2621631167662 + ,-6.58703494926408 + ,-18.4151121488591 + ,-14.8681026131873 + ,-47.6597928632744 + ,-21.293904703775 + ,-11.6409150203995 + ,26.1899365185078 + ,29.7044265842977 + ,45.4646645514389 + ,38.3894094551673 + ,23.0981672860589 + ,21.4230559933152 + ,18.2417705684547 + ,11.157279776497 + ,-0.715531051159587 + ,-15.1270416645751 + ,-7.22130840920806 + ,-11.9284736299649 + ,4.3668514752772 + ,-1.85418489259808 + ,-18.396933394698 + ,-4.57517496021046 + ,-6.36700775201803 + ,28.3572903325393 + ,-15.1385061458589 + ,-28.8375079913542 + ,3.69140933823331 + ,-17.8183731179381 + ,-25.4540690887963 + ,0.697336464221678 + ,0.513021945883395 + ,13.1123459544277 + ,27.375749706785 + ,6.70366039572968 + ,1.72995278986326 + ,18.8723760603616 + ,8.45675736115044 + ,-8.36206670515787 + ,-13.1309014264256 + ,-21.9384359334522 + ,-11.316210111774 + ,15.7931172337804 + ,9.19304281295445 + ,12.0766069190111 + ,-0.158542529553074 + ,1.87081495847008 + ,5.56132937684214 + ,-0.0320253284210139 + ,24.3951859793569 + ,-25.9808080799622 + ,-2.75573658894825 + ,-10.0693648836933 + ,3.01810007287617 + ,-3.00733344667827 + ,7.28490386261939 + ,-8.83922030120033 + ,8.43332454445152 + ,-12.5296236733093 + ,10.5849465226221 + ,8.21564759491815 + ,25.7833624702596 + ,-8.25212802149616 + ,3.96194568339797 + ,-3.76268039746691 + ,5.60193272405382 + ,8.65364736945077 + ,1.61018538247964 + ,-20.3496380776089 + ,-39.7826145245488 + ,-25.4510840349012 + ,-9.77951072936571 + ,19.8081934525346 + ,28.3641637082268 + ,-1.68307140317813 + ,7.85290337413733 + ,-5.54982163430628 + ,8.42796042368923 + ,0.0928440055608917 + ,7.89581561993737 + ,-14.0175742388036 + ,-21.8600192005484 + ,-23.037957225706 + ,-15.1679115432987 + ,-17.2817349845265 + ,25.3301124410899 + ,8.53875449960913 + ,9.13744833432287 + ,21.6974423832777 + ,45.2415933588997 + ,20.6728458583979 + ,3.13644765577152 + ,-31.2163120199723 + ,-16.3833863471703 + ,-26.4859537377811 + ,-28.4965981176658 + ,-23.7911116211856 + ,36.696833525137 + ,21.7815733043625 + ,10.685830460587 + ,13.5513878310525 + ,22.27837801177 + ,9.7924697163636 + ,-5.80466174159562 + ,-30.4181546726723 + ,-34.8358531079964 + ,-29.4890446067332 + ,-12.9710399682596 + ,-18.5369044534211 + ,14.1079604702348 + ,12.4496200267936 + ,7.09166280966235 + ,27.6950058067722 + ,24.8204626418524 + ,-16.7669789991913 + ,-35.666284563673 + ,-38.881951601272 + ,-20.1755054827821 + ,-14.2045524277049 + ,-6.65080261426306 + ,-16.1809219244564 + ,24.2566315261574 + ,15.7909796096739 + ,4.42774397800889 + ,15.2258085605849 + ,18.172916637119 + ,21.7071262375293 + ,16.228155289703 + ,15.1328228687593 + ,4.221479788034 + ,-4.02535635610417 + ,-15.2689128995269 + ,-26.7963385665849 + ,9.45679179427765 + ,15.6067167880431 + ,20.0086736859531 + ,15.1719307981042 + ,4.98222085991449 + ,8.779612445601 + ,-3.12079604344592 + ,1.6624339943898 + ,-8.77900771300335 + ,-3.25594248380924 + ,-13.0611815411808 + ,-24.7502897221875 + ,15.28708151674 + ,17.3212473885702 + ,22.7823530321417 + ,25.9047588899543 + ,29.2833536574919 + ,-6.4509500510942 + ,-16.8458040939865 + ,-26.8570196099963 + ,-13.3300687467932 + ,-17.9386109470027 + ,-8.81107910829854 + ,-21.7674163932296 + ,11.0939195225194 + ,4.9520500711713 + ,0.829786515983244 + ,12.5688231750361 + ,-13.5626083263094 + ,-7.70693830377883 + ,-12.5940635381495 + ,6.8024497543625 + ,4.75206969542046 + ,-16.8338034269343 + ,-33.1144921099329 + ,-38.0790499165669 + ,-4.39061960073718 + ,-10.8053946520047 + ,-42.5701834010817 + ,-19.1736719359176 + ,-48.9071564856791 + ,-36.2535395115642 + ,-24.4263000557075 + ,82.1845779270318 + ,62.3146814178742 + ,66.7092918453038 + ,36.7672342436149 + ,22.6413075182908 + ,39.5702183038967 + ,21.3959237224055 + ,4.89182620853535 + ,8.24902890890621 + ,4.31995604367148 + ,-10.6220152976869 + ,-7.70793075700465 + ,26.1897923105604 + ,8.75615568618377 + ,-13.2129740016054 + ,-33.8277047092123 + ,-67.9263045404545 + ,-3.50643896828501 + ,13.5102212367874 + ,19.6265424537694 + ,7.60416388499254 + ,5.25851506654385 + ,10.8999677719715 + ,5.56674975050043 + ,19.6171702559119 + ,42.4005548988072 + ,15.9484464782897 + ,-36.6024109254785 + ,-50.4371374528818 + ,15.7757585931204 + ,-3.91455072797442 + ,17.9588622881995 + ,12.1935755186144 + ,14.9393101500264 + ,14.2721463053147 + ,-26.0102537907259 + ,11.4909846401163 + ,-6.15575459403772 + ,-1.83798689160437 + ,-37.2946314110783 + ,-35.1351450541873 + ,-16.5044373853491 + ,21.923064916392 + ,6.30580716075735 + ,13.9498496193636 + ,-0.724386281069428 + ,-2.31152065762626 + ,8.28910924278432) > 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/17rvr1352540795.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/2rbbe1352540795.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/3tybr1352540795.tab") + } > > try(system("convert tmp/17rvr1352540795.ps tmp/17rvr1352540795.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.924 0.190 1.095