R version 3.0.2 (2013-09-25) -- "Frisbee Sailing" Copyright (C) 2013 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-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(1053000,1014000,1072500,858000,1111500,1092000,1170000,1209000,1345500,1170000,1111500,1384500,1170000,877500,1033500,780000,1092000,897000,1189500,1072500,1131000,1267500,1248000,1482000,1072500,897000,994500,721500,1033500,799500,1131000,1072500,955500,1365000,1228500,1404000,1053000,975000,877500,721500,955500,858000,1170000,1131000,975000,1306500,1209000,1560000,1248000,760500,760500,760500,897000,897000,1209000,1111500,994500,1248000,1150500,1657500,1306500,760500,799500,663000,916500,1053000,1326000,1306500,1053000,1228500,1092000,1560000,1189500,955500,858000,643500,955500,1150500,1345500,1267500,936000,1345500,1053000,1618500,1345500,975000,897000,604500,955500,916500,1384500,1384500,1053000,1365000,1014000,1579500,1345500,994500,760500,526500,1033500,994500,1306500,1501500,1111500,1248000,936000,1618500) > library(Hmisc) Loading required package: grid Loading required package: lattice Loading required package: survival Loading required package: splines Loading required package: Formula Attaching package: 'Hmisc' The following objects are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > m <- mean(x) > e <- median(x) > postscript(file="/var/wessaorg/rcomp/tmp/1ahvw1439198481.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=13.888888888889,height=13.888888888889) > op <- par(mfrow=c(2,1)) > mydensity1 <- density(x,kernel='gaussian',na.rm=TRUE) > plot(mydensity1,main='Density Plot - Gaussian Kernel',xlab='Median (0 -> full line) | Mean (0 -> dashed line)',ylab='density') > abline(v=e,lty=1) > abline(v=m,lty=5) > grid() > myseq <- seq(0.01, 0.99, 0.01) > hd <- hdquantile(x, probs = myseq, se = TRUE, na.rm = FALSE, names = TRUE, weights=FALSE) > plot(myseq,hd,col=2,main='Harrell-Davis Quantiles',xlab='quantiles',ylab='Median (0 -> full) | Mean (0 -> dashed)') > abline(h=m,lty=5) > abline(h=e,lty=1) > grid() > par(op) > dev.off() null device 1 > > #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,'Median versus Mean',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mean',header=TRUE) > a<-table.element(a,mean(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'median',header=TRUE) > a<-table.element(a,median(x)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2ezey1439198481.tab") > > try(system("convert tmp/1ahvw1439198481.ps tmp/1ahvw1439198481.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.972 0.162 1.135