R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(294.371 + ,155.359 + ,167.804 + ,82.893 + ,103.131 + ,130.093 + ,166.796 + ,72.174 + ,96.396 + ,81.056 + ,138.981 + ,197.604 + ,264.405 + ,119.403 + ,189.62 + ,155.779 + ,134.168 + ,126.862 + ,159.104 + ,163.426 + ,113.344 + ,175.645 + ,147.312 + ,164.642 + ,125.814 + ,138.558 + ,163.136 + ,148.763 + ,178.322 + ,107.805 + ,180.363 + ,179.006 + ,111.603 + ,251.469 + ,123.646 + ,108.398 + ,134.505 + ,129.605 + ,211.562 + ,300.239 + ,329.183 + ,115.475 + ,115.108 + ,101.922 + ,391.433 + ,103.906 + ,112.704 + ,619.22 + ,110.688 + ,95.539 + ,150.985 + ,138.107 + ,177.705 + ,757.365 + ,103.671 + ,81.101 + ,130.586 + ,166.608 + ,201.734 + ,175.329 + ,126.372 + ,107.822 + ,146.123 + ,98.815 + ,219.641 + ,156 + ,123.928 + ,156.405 + ,104.828 + ,188.594 + ,575.698 + ,564.424 + ,149.465 + ,168.474 + ,280.909 + ,172.095 + ,73.594 + ,128.317 + ,202.431 + ,149.787 + ,243.719 + ,188.553 + ,125.634 + ,166.548 + ,284.966 + ,122.213 + ,172.936 + ,152.882 + ,242.736 + ,107.814 + ,155.723 + ,192.582 + ,126.668 + ,127.17 + ,125.77 + ,144.493 + ,123.241 + ,138.431 + ,150.875 + ,375.445 + ,154.611 + ,83.401 + ,115.175 + ,198.463 + ,520.108 + ,235.576 + ,105.44 + ,152.272 + ,310.469 + ,217.089 + ,229.36 + ,555.232 + ,466.984 + ,127.703 + ,101.383 + ,172.705 + ,79.114 + ,213.859 + ,256.736 + ,161.995 + ,112.314 + ,219.779 + ,188.723 + ,141.648 + ,146.564 + ,113.163 + ,85.657 + ,127.958 + ,114.909 + ,198.214 + ,133.215 + ,131.576 + ,287.667 + ,140.275 + ,137.435 + ,190.055 + ,104.39 + ,178.032 + ,79.356 + ,250.571 + ,123.115 + ,247.026 + ,190.38 + ,219.114 + ,131.753 + ,135.922 + ,855.826 + ,145.195 + ,82.337 + ,141.758 + ,78.649 + ,117.482 + ,90.986 + ,101.864 + ,120.33 + ,137.019) > par4 = 'Unknown' > par3 = 'FALSE' > par2 = 'grey' > par1 = '30' > xlab = 'x' > main = 'Histogram' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, 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: > #Technical description: > x <- x[x<400] > 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/rcomp/tmp/1ipzt1289576208.ps",horizontal=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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab + load(file="/var/www/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/rcomp/tmp/278wm1289576208.tab") + } else { + mytab + reltab <- mytab / sum(mytab) + n <- length(mytab) + + #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab + load(file="/var/www/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/www/rcomp/tmp/3brua1289576208.tab") + } > try(system("convert tmp/1ipzt1289576208.ps tmp/1ipzt1289576208.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.550 0.160 0.678