R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" 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. > y <- c(102,112,118,122,106,149,122,86,117,97,132,87,101,115,109,159,131,120,86,105,100,132,105,121,120,126,138,118,130,103,129,150,88,125,112,144,127,117,108,139,97,115,95,91,102,124,106,125,130,79,108,136,108,139,110,114,118,120,108,130,130,112,94) > x <- c(127,108,110,104,140,115,121,112,105,111,151,100,115,124,69,113,123,123,84,121,119,98,109,129,119,119,122,82,114,100,99,132,82,107,114,110,109,106,124,91,128,98,133,124,142,96,93,92,117,130,87,92,114,81,115,123,115,117,103,113,117,133,103,117,113,127,126,119,97,105,140,112,113,92,98,122,100,84,142,137,105,104,98,120,123,90,119,105,135,101,114,122,132,114,103,115,108,105) > par5 = 'Male' > par4 = 'Female' > par3 = 'TRUE' > par2 = 'yellow' > par1 = 'red' > ylab = ' ' > main = 'Back to Back Histogram' > par5 <- 'Male' > par4 <- 'Female' > par3 <- 'TRUE' > par2 <- 'yellow' > par1 <- 'red' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., (2012), Back to Back Histogram (v1.0.4) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_backtobackhist.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > # > if (par3 == 'TRUE') par3 <- TRUE > if (par3 == 'FALSE') par3 <- FALSE > library(Hmisc) Loading required package: survival Loading required package: splines Hmisc library by Frank E Harrell Jr Type library(help='Hmisc'), ?Overview, or ?Hmisc.Overview') to see overall documentation. NOTE:Hmisc no longer redefines [.factor to drop unused levels when subsetting. To get the old behavior of Hmisc type dropUnusedLevels(). Attaching package: 'Hmisc' The following object(s) are masked from 'package:survival': untangle.specials The following object(s) are masked from 'package:base': format.pval, round.POSIXt, trunc.POSIXt, units > z <- data.frame(cbind(x,y)) Warning message: In cbind(x, y) : number of rows of result is not a multiple of vector length (arg 2) > names(z) <- list(par4,par5) > postscript(file="/var/fisher/rcomp/tmp/1pdkh1350387994.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > out <- histbackback(z, probability=par3, main = main, ylab = ylab) > barplot(-out$left, col=par1, horiz=TRUE, space=0, add=TRUE, axes=FALSE) > barplot(out$right, col=par2, horiz=TRUE, space=0, add=TRUE, axes=FALSE) > dev.off() null device 1 > > try(system("convert tmp/1pdkh1350387994.ps tmp/1pdkh1350387994.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.105 0.157 1.241