R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(115.01 + ,124.56 + ,128.60 + ,131.54 + ,124.93 + ,126.77 + ,128.97 + ,149.91 + ,149.55 + ,149.91 + ,159.47 + ,162.04 + ,163.88 + ,166.82 + ,173.80 + ,172.06 + ,178.21 + ,174.53 + ,176.37 + ,168.65 + ,166.82 + ,164.24 + ,163.51 + ,164.61 + ,163.51 + ,164.61 + ,167.92 + ,160.94 + ,156.53 + ,159.47 + ,149.18 + ,135.58 + ,124.93 + ,116.84 + ,114.27 + ,114.64 + ,112.80 + ,113.17 + ,111.33 + ,113.91 + ,119.42 + ,120.89 + ,122.04 + ,120.15 + ,118.21 + ,125.33 + ,135.37 + ,146.89 + ,149.54 + ,160.84 + ,169.95 + ,177.13 + ,169.35 + ,159.93 + ,149.69 + ,148.67 + ,136.32 + ,128.17 + ,138.74 + ,140.58 + ,147.57 + ,147.83 + ,155.65 + ,148.88 + ,147.90 + ,141.99 + ,136.58 + ,121.82 + ,127.52 + ,129.80 + ,131.29 + ,135.96 + ,146.50 + ,158.65 + ,153.21 + ,147.04 + ,141.04 + ,140.45 + ,140.15 + ,139.30 + ,137.60 + ,146.02 + ,158.79 + ,167.19 + ,161.99 + ,164.62 + ,156.21 + ,154.42 + ,150.39 + ,148.98 + ,158.61 + ,169.98 + ,190.09 + ,184.39 + ,193.67 + ,203.79 + ,204.07 + ,208.92 + ,206.88 + ,218.89 + ,215.52 + ,251.66 + ,262.11 + ,227.27 + ,202.60 + ,191.63 + ,178.71 + ,178.32 + ,176.41 + ,175.70 + ,175.73 + ,172.35 + ,176.61 + ,183.49 + ,172.59 + ,148.39 + ,138.31 + ,150.61 + ,151.74 + ,151.66 + ,149.88 + ,144.62 + ,137.10 + ,140.05 + ,138.92 + ,130.15 + ,128.92 + ,120.64 + ,118.54 + ,107.95 + ,107.93 + ,126.54 + ,130.21 + ,126.21 + ,125.29 + ,117.03 + ,117.34 + ,113.87 + ,113.00 + ,111.41 + ,103.02 + ,111.41 + ,113.19 + ,108.10 + ,108.80 + ,102.16 + ,105.83 + ,108.41 + ,105.70 + ,105.11 + ,110.78 + ,113.51 + ,108.98 + ,108.28 + ,117.49 + ,128.22 + ,127.73 + ,128.01 + ,132.84 + ,128.12 + ,130.28 + ,129.30 + ,135.00 + ,127.23 + ,123.79 + ,121.92 + ,122.03 + ,123.34 + ,125.27 + ,122.53 + ,125.31 + ,123.28 + ,122.56 + ,123.72 + ,121.46 + ,132.03 + ,149.30 + ,161.26 + ,187.84 + ,190.32 + ,176.26 + ,168.98 + ,149.60 + ,150.84 + ,141.81 + ,138.62 + ,141.96 + ,131.35 + ,131.62 + ,148.72 + ,145.62 + ,147.46 + ,160.55 + ,165.57 + ,166.33 + ,161.39 + ,166.28 + ,166.58 + ,163.73 + ,154.74 + ,150.60 + ,141.29 + ,151.03 + ,150.15 + ,156.57 + ,153.87 + ,153.59 + ,151.30 + ,150.99 + ,140.88 + ,144.25 + ,141.93 + ,143.87 + ,149.36 + ,159.71 + ,167.83 + ,161.12 + ,164.44 + ,167.16 + ,179.84 + ,174.44 + ,180.35 + ,193.17 + ,195.16 + ,202.43 + ,189.91 + ,195.98 + ,212.09 + ,205.81 + ,204.31 + ,196.07 + ,199.98 + ,199.10 + ,198.31 + ,195.72 + ,223.04 + ,238.41 + ,259.73 + ,326.54 + ,335.15 + ,321.81 + ,368.62 + ,369.59 + ,425.00 + ,439.72 + ,362.23 + ,328.76 + ,348.55 + ,328.18 + ,329.34 + ,295.55 + ,237.38 + ,226.85 + ,220.14 + ,239.36 + ,224.69 + ,230.98 + ,233.47 + ,256.70 + ,253.41 + ,224.95 + ,210.37 + ,191.09 + ,198.85 + ,211.04 + ,206.25 + ,201.51 + ,194.54 + ,191.07 + ,192.82 + ,181.88 + ,157.67 + ,195.82 + ,246.25 + ,271.69 + ,270.23 + ,274.08 + ,306.53 + ,326.55 + ,348.15 + ,316.75 + ,336.12 + ,354.47 + ,326.43 + ,303.88 + ,327.07 + ,315.92 + ,289.01 + ,281.01 + ,269.03 + ,274.89 + ,277.77 + ,283.88 + ,266.32 + ,264.36 + ,276.19 + ,345.69 + ,349.40 + ,353.42 + ,358.20 + ,361.00) > par4 = 'Unknown' > par3 = 'FALSE' > par2 = 'grey' > par1 = '' > xlab = 'x' > main = 'Histogram' > par4 <- 'Unknown' > par3 <- 'FALSE' > par2 <- 'grey' > par1 <- '' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Histogram (v1.0.12) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_histogram.wasp/ > #Source of accompanying publication: > # > 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/wessaorg/rcomp/tmp/1poo71355068485.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab + load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/2mcq41355068485.tab") + } else { + mytab + reltab <- mytab / sum(mytab) + n <- length(mytab) + + #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab + load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/39iqh1355068485.tab") + } > > try(system("convert tmp/1poo71355068485.ps tmp/1poo71355068485.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.842 0.202 1.022