R version 2.8.1 (2008-12-22) Copyright (C) 2008 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(18.09 + ,18.13 + ,18 + ,17.72 + ,17.62 + ,17.13 + ,17.39 + ,17.09 + ,17.14 + ,17.38 + ,16.8 + ,16.51 + ,16.01 + ,15.05 + ,13.56 + ,15.22 + ,14.91 + ,15.13 + ,15.25 + ,14.61 + ,14.87 + ,15.1 + ,15.22 + ,15.46 + ,14.96 + ,14 + ,14.2 + ,13.9 + ,13.63 + ,13.32 + ,13.8 + ,14.5 + ,14.12 + ,13.88 + ,14.11 + ,14.26 + ,14.71 + ,14.52 + ,14.32 + ,14.69 + ,15.25 + ,15.04 + ,14.82 + ,14.5 + ,14.72 + ,14.6 + ,14.58 + ,14 + ,14.75 + ,14.41 + ,15.19 + ,14.96 + ,14.83 + ,14.25 + ,14.32 + ,14.93 + ,14.65 + ,15.65 + ,15.65 + ,15.61 + ,15.95 + ,15.83 + ,15.77 + ,16.7 + ,16.69 + ,16.4 + ,16.77 + ,16.78 + ,16.84 + ,16.68 + ,16.67 + ,16.3 + ,16.37 + ,16.6 + ,16.72 + ,16.82 + ,17.5 + ,17.2 + ,17.29 + ,17.2 + ,17.2 + ,17.32 + ,17.16 + ,17.41 + ,17.31 + ,17.3 + ,17.34 + ,17.19 + ,17.05 + ,17.07 + ,17.07 + ,16.81 + ,16.81 + ,16.96 + ,17.05 + ,17 + ,16.77 + ,16.66 + ,16.2 + ,16.26 + ,15.84 + ,15.85 + ,15.71 + ,15.84 + ,15.73 + ,15.77 + ,15.3 + ,15.41 + ,15.4 + ,15.61 + ,15 + ,14.12 + ,14.01 + ,13.46 + ,13.85 + ,13.92 + ,13.59 + ,13.67 + ,13.05 + ,12.87 + ,12.28 + ,11.88 + ,12.49 + ,11.9 + ,10.8 + ,10.99 + ,10.15 + ,10.07 + ,10.05 + ,10.31 + ,9.94 + ,9.65 + ,9.74 + ,9.85 + ,9.96 + ,9.63 + ,9.43 + ,8.77 + ,9.53 + ,9.5 + ,9.78 + ,9.9 + ,9.93 + ,10.35 + ,9.79 + ,9.63 + ,9.02 + ,9.25 + ,9.11 + ,8.95 + ,9.3 + ,9.13 + ,9.75 + ,9.65 + ,9.27 + ,9.59 + ,9.58 + ,9.98 + ,9.57 + ,9.6 + ,9.64 + ,9.46 + ,9.19 + ,9.02 + ,8.9 + ,9.12 + ,8.86 + ,8.94 + ,9 + ,9.23 + ,9.39 + ,9.62 + ,9.9 + ,9.8 + ,9.2 + ,9.87 + ,9.6 + ,9.37 + ,9.21 + ,9.15 + ,8.7 + ,8.2 + ,8.1 + ,6.68 + ,7.7 + ,8.2 + ,7.55 + ,7.53 + ,7.02 + ,6.6 + ,6 + ,3.95 + ,4.91 + ,5.15 + ,5.7 + ,1.93 + ,1.36 + ,1.1 + ,0.98 + ,1 + ,1.1 + ,1.06 + ,1.01 + ,0.93 + ,0.89 + ,0.9 + ,0.88 + ,0.85 + ,0.84 + ,0.94 + ,1 + ,1.1 + ,1.15 + ,1.05 + ,1.06 + ,0.99 + ,0.93 + ,0.84 + ,0.9 + ,0.86 + ,0.78 + ,0.77 + ,0.6 + ,0.57 + ,0.62 + ,0.62 + ,0.58 + ,0.6 + ,0.73 + ,0.75 + ,0.63 + ,0.71 + ,0.68 + ,0.64 + ,0.66 + ,0.69 + ,0.72 + ,0.92 + ,0.85 + ,0.95 + ,1 + ,1.15 + ,1.07 + ,1.01 + ,0.99 + ,0.95 + ,0.92 + ,0.94 + ,0.96 + ,1.05 + ,1.04 + ,1.1 + ,1.14 + ,1.12 + ,1.19 + ,1.35 + ,1.62 + ,1.43 + ,1.45 + ,1.47 + ,1.35 + ,1.15 + ,1.46 + ,1.3 + ,1.3 + ,1.5 + ,1.52 + ,1.63 + ,1.9 + ,1.65 + ,1.5 + ,1.38 + ,1.39) > 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/1svna1234798038.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] 0 2 4 6 8 10 12 14 16 18 20 $counts [1] 78 1 3 7 53 9 15 57 47 3 $intensities [1] 0.142857143 0.001831502 0.005494505 0.012820513 0.097069597 0.016483516 [7] 0.027472527 0.104395604 0.086080586 0.005494504 $density [1] 0.142857143 0.001831502 0.005494505 0.012820513 0.097069597 0.016483516 [7] 0.027472527 0.104395604 0.086080586 0.005494504 $mids [1] 1 3 5 7 9 11 13 15 17 19 $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/29jxb1234798038.tab") > > system("convert tmp/1svna1234798038.ps tmp/1svna1234798038.png") > > > proc.time() user system elapsed 0.367 0.156 0.459