R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(10.17463007 + ,11.70685947 + ,0.336629956 + ,12.81545815 + ,18.48134929 + ,19.15 + ,11.98976509 + ,15.96311694 + ,12.36867636 + ,17.85359417 + ,13.33972078 + ,17.43586247 + ,7.971763963 + ,16.49423975 + ,9.589676646 + ,13.0201353 + ,18.30998406 + ,5.311440585 + ,16.14544025 + ,9.61483208 + ,6.97001928 + ,17.8328823 + ,10.43631816 + ,12.49521893 + ,13.13014142 + ,12.5995365 + ,16.89272827 + ,15.95822221 + ,17.44624506 + ,13.36096345 + ,11.70208318 + ,12.6700532 + ,9.942922584 + ,12.47787034 + ,16.1794073 + ,11.34269609 + ,10.61458743 + ,13.63362964 + ,19.3 + ,14.17862044 + ,12.13110302 + ,14.29122225 + ,15.90424527 + ,15.30537883 + ,12.71711954 + ,10.1041787 + ,15.10633448 + ,14.97472539 + ,13.14940394 + ,8.803370342 + ,11.37671367 + ,16.48829016 + ,15.28690517 + ,15.87449367 + ,8.991891655 + ,14.52069002 + ,10.73329293 + ,12.11255989 + ,13.12039076 + ,11.17618446 + ,9.852452086 + ,10.83826353 + ,10.01602482 + ,9.98429329 + ,13.90654664 + ,17.43829448 + ,14.13651406 + ,12.95465875 + ,6.405875596 + ,13.00827743 + ,8.843896805 + ,14.95275123 + ,9.985399433 + ,15.85289071 + ,6.304871788 + ,11.70744131 + ,14.6847188 + ,9.063740747 + ,14.09669644 + ,11.45807414 + ,14.5766967 + ,8.013459929 + ,10.91719297 + ,9.680449615 + ,12.30631181 + ,19.15 + ,9.974038576 + ,10.61396958 + ,12.39969169 + ,13.89235106 + ,15.3368091 + ,11.27570477 + ,11.46890639 + ,7.705473469 + ,17.80919895 + ,17.4519668 + ,2.080910919 + ,13.09820752 + ,11.29135539 + ,2.507172277 + ,7.823664497 + ,10.96662538 + ,8.284173862 + ,5.69261529 + ,4.687276457 + ,13.25987215 + ,3.580093526 + ,9.733116837 + ,11.88651299 + ,11.3271032 + ,12.99614065 + ,10.51715507 + ,13.71616844 + ,15.32447894 + ,13.82274766 + ,11.71158746 + ,1.908370816 + ,13.82088431 + ,8.241327352 + ,10.5053078 + ,8.180917703 + ,2.322655495 + ,12.28598307 + ,12.54906448 + ,13.11109062 + ,11.7934321 + ,10.81286184 + ,3.068772109 + ,9.674855276 + ,11.39973018 + ,7.166265475 + ,13.46103292 + ,9.81357389) > par4 = 'Unknown' > par3 = 'FALSE' > par2 = 'grey' > par1 = '' > 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: > 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/1nwzm1323791056.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/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/28vt61323791056.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/3smai1323791056.tab") + } > > try(system("convert tmp/1nwzm1323791056.ps tmp/1nwzm1323791056.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.576 0.112 0.748