R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(10.5 + ,10.5 + ,10.31 + ,10.14 + ,10.81 + ,13.94 + ,13.91 + ,13.52 + ,12.77 + ,12.16 + ,11.63 + ,11.04 + ,10.29 + ,10.04 + ,9.62 + ,9.24 + ,8.88 + ,8.54 + ,8.22 + ,7.89 + ,7.16 + ,6.05 + ,5.17 + ,4.41 + ,3.7 + ,2.08 + ,-7.31 + ,-8.01 + ,-6.72 + ,-2.83 + ,-0.98 + ,1.01 + ,4.79 + ,6.29 + ,7.56 + ,8.32 + ,8.47 + ,7.48 + ,6.85 + ,9.66 + ,8.52 + ,7.32 + ,6.58 + ,5.7 + ,4.8 + ,3.69 + ,2.56 + ,5.35 + ,4.91 + ,3.92 + ,3.1 + ,2.38 + ,1.6 + ,0.64 + ,-0.31 + ,-1.32 + ,-2.3 + ,1.49 + ,3.92 + ,3.13 + ,1.97 + ,1 + ,4.36 + ,4.3 + ,3.25 + ,2.13 + ,1.23 + ,0.12 + ,-0.81 + ,5.15 + ,3.49 + ,1.89 + ,0.64 + ,-0.62 + ,-2.08 + ,-0.39 + ,-0.74 + ,-2.13 + ,-3.49 + ,-4.99 + ,-2.39 + ,-1.87 + ,-2.24 + ,-3.7 + ,-4.03 + ,-5.46 + ,-6.4 + ,-6.43 + ,-6.77 + ,-7.42 + ,-9.01 + ,-7.52 + ,-6.98 + ,-8.4 + ,-9.16 + ,-8.39 + ,-9.83 + ,-11.57 + ,-10.14 + ,-13.33 + ,-16.12 + ,-14.44 + ,-16.46 + ,-18.14 + ,-16.32 + ,-18.19 + ,-14.91 + ,-14.93 + ,-9.34 + ,0.28 + ,14.96 + ,16.37 + ,17.37 + ,16.33 + ,14.73 + ,13.18 + ,11.38 + ,10.2 + ,11.25 + ,9.46 + ,7.87 + ,6.45 + ,4.92 + ,3.47 + ,2.02 + ,0.73 + ,-0.58 + ,-1.74 + ,-2.78 + ,-1.29 + ,0.36 + ,-0.63 + ,-0.51 + ,1.41 + ,-0.29 + ,0.53 + ,-0.13 + ,-1.79 + ,-3.27 + ,-4.71 + ,-6.19 + ,-4.82 + ,-0.49 + ,-1.92 + ,-1.85 + ,-4.88 + ,-5.77 + ,0.69 + ,-1 + ,-0.18 + ,-0.71 + ,-2.21 + ,-3.76 + ,-4.13 + ,-3.62 + ,-5.25 + ,-7 + ,-8.8 + ,-6.82 + ,-4.62 + ,-6.31 + ,-7.92 + ,-9.41 + ,-10.91 + ,-4.62 + ,-5.44 + ,-6.85 + ,-8.34 + ,-9.62 + ,-10.77 + ,-9.53 + ,-5.87 + ,-7.03 + ,-8.19 + ,-9.3 + ,-10.47 + ,-11.97 + ,-10.2 + ,-10.81 + ,-12.08 + ,-12.08 + ,-15.84 + ,-17.7 + ,-18.36 + ,-19.01 + ,-19.67 + ,-23.47 + ,-26.82 + ,-27.38 + ,-27.94 + ,-28.48 + ,-29.04 + ,-29.54 + ,-30.02 + ,-30.49 + ,-27.88 + ,-27.55 + ,-28.25 + ,-28.75 + ,-22.44 + ,-22.99 + ,-23.54 + ,-23.82 + ,-24.61 + ,-25.08 + ,-18.23 + ,1.42 + ,0.25 + ,-0.59 + ,0.37 + ,-0.91 + ,18.69 + ,32.89 + ,35.5 + ,35.23 + ,31.15 + ,29.18 + ,28.28 + ,26.2 + ,25.42 + ,28.45 + ,25.07 + ,23.11 + ,19.45 + ,17.98 + ,14.73 + ,14.85 + ,14.76 + ,8.45 + ,11.05 + ,10.6 + ,7.66 + ,8.41 + ,7.25 + ,9.95 + ,25.74 + ,27.67 + ,30.2 + ,30.24 + ,22.48 + ,17.67 + ,36.66 + ,80.55 + ,70.6 + ,95.11 + ,95.17 + ,55.93 + ,49.24 + ,44.4 + ,38.67 + ,33.7 + ,41.07 + ,40.85 + ,47.87 + ,32.81 + ,34.49 + ,23 + ,21.43 + ,22.42 + ,21.19 + ,12.77 + ,11.13 + ,16.56 + ,17.64 + ,16.42 + ,13.51 + ,14.68 + ,13.2 + ,11.57 + ,11.63 + ,5.66 + ,3.11 + ,-1.09 + ,-1.12 + ,7.72 + ,19.95 + ,10.7 + ,5.61 + ,6.7 + ,2.53 + ,1.38 + ,-4.01 + ,-4.33 + ,-8.32 + ,-9.16 + ,-8.02 + ,-6.71 + ,-8.23 + ,-11.48 + ,-17.82 + ,-17.61 + ,-14.41 + ,-10.5 + ,-21.16 + ,-21.55 + ,-20.93 + ,-20.03 + ,-25.89 + ,-22.9 + ,-23.83 + ,-21.7 + ,-23.17 + ,-18 + ,-14.93 + ,-20.87 + ,-23.46 + ,-30.37 + ,-32.21 + ,-26.78 + ,-26.78 + ,-23.42 + ,-30.55 + ,-26.33 + ,-27.71 + ,-30.93 + ,-28.33 + ,-26.82 + ,-30.25 + ,-26.27 + ,-29.2 + ,-28.73 + ,-29.94 + ,-29.11 + ,-27.62 + ,-21.24 + ,-20.96 + ,-18.56 + ,-20.59 + ,-19.01 + ,-13.59 + ,-22.02 + ,-21.04 + ,-14.24 + ,-15.39 + ,-7.18 + ,2.45 + ,3.22 + ,16.9 + ,30.85 + ,23.4 + ,20.52 + ,13.67 + ,3.86 + ,3.8 + ,-0.96 + ,8.81 + ,12.57 + ,12.64 + ,27.95 + ,18.54 + ,12.49 + ,13.66 + ,10.19 + ,3.2 + ,4.44 + ,10.57 + ,6.86 + ,5.44 + ,17.62 + ,25.4) > par4 = 'Unknown' > par3 = 'FALSE' > par2 = 'grey' > par1 = '' > xlab = 'x' > main = 'Histogram' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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/www/html/rcomp/tmp/16r4g1255694693.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > 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) + } > dev.off() null device 1 > myhist $breaks [1] -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 $counts [1] 7 46 37 90 86 54 18 12 5 1 0 1 1 2 $intensities [1] 0.0019444444 0.0127777778 0.0102777778 0.0250000000 0.0238888889 [6] 0.0150000000 0.0050000000 0.0033333333 0.0013888889 0.0002777778 [11] 0.0000000000 0.0002777778 0.0002777778 0.0005555554 $density [1] 0.0019444444 0.0127777778 0.0102777778 0.0250000000 0.0238888889 [6] 0.0150000000 0.0050000000 0.0033333333 0.0013888889 0.0002777778 [11] 0.0000000000 0.0002777778 0.0002777778 0.0005555554 $mids [1] -35 -25 -15 -5 5 15 25 35 45 55 65 75 85 95 $xname [1] "x" $equidist [1] TRUE attr(,"class") [1] "histogram" > n <- length(x) > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/www/html/rcomp/tmp/2t4kb1255694693.tab") > > system("convert tmp/16r4g1255694693.ps tmp/16r4g1255694693.png") > > > proc.time() user system elapsed 0.386 0.163 0.493