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(8357,7454,8076,7248,7339,7292,7359,7537,7441,8057,8037,8257,8692,8119,8236,7432,7669,7453,7566,7731,7657,8130,8401,8737,9009,7919,8228,7903,7912,7857,7965,8091,8024,8772,8656,8953,9014,8103,8876,8231,8173,8087,8296,8007,8382,9168,9137,9321,9234,8451,9101,8279,8284,8225,8597,8305,8620,9102,9258,9652,9522,8874,9415,8525,8862,8421,8626,8750,8852,9412,9570,9513,9986,8907,9663,8799,8931,8732,8936,9127,9070,9773,9670,9929,10095,9025,9659,8954,9022,8855,9034,9196,9038,9650,9715,10052,10436,9314,9717,8997,9062,8885,9058,9095,9149,9857,9848,10269,10341,9690,10125,9349,9224,9224,9454,9347,9430,9933,10148,10677,10735,9760,10567,9333,9409,9502,9348,9319,9594,10160,10182,10810,11105,9874,10958,9311,9610,9398,9784,9425,9557,10166,10337,10770,11265,10183,10941,9628,9709,9637,9579,9741,9754,10508,10749,11079,11608,10668,10933,9703,9799,9656,9648,9712,9766,10540,10564,10911,11218,10230,10410,9227,9378,9105,9128) > 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/1f5z11254686129.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] 7000 7500 8000 8500 9000 9500 10000 10500 11000 11500 12000 $counts [1] 8 10 25 23 40 36 14 14 4 1 $intensities [1] 9.142857e-05 1.142857e-04 2.857143e-04 2.628571e-04 4.571429e-04 [6] 4.114286e-04 1.600000e-04 1.600000e-04 4.571429e-05 1.142857e-05 $density [1] 9.142857e-05 1.142857e-04 2.857143e-04 2.628571e-04 4.571429e-04 [6] 4.114286e-04 1.600000e-04 1.600000e-04 4.571429e-05 1.142857e-05 $mids [1] 7250 7750 8250 8750 9250 9750 10250 10750 11250 11750 $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/2ix1k1254686129.tab") > > system("convert tmp/1f5z11254686129.ps tmp/1f5z11254686129.png") > > > proc.time() user system elapsed 0.366 0.137 0.436