Hi R-Experts, How can I show all the relevant measures like mean, median, min. value, max. value, outlier in a single boxplot diagram? Suppose I have a data set c(2,4,5,7,12,14,15,13,8,5,23,98,11) Sumanta Basak. [[alternative HTML version deleted]]
You can always use points() mat <- matrix(rnorm(360),nrow=10) boxplot(mat~col(mat)) means <- apply(mat,2, mean) points(1:36,means,pch="X",col="red") -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Sumanta Basak Sent: 07 March 2006 09:55 To: r-help at stat.math.ethz.ch Subject: [R] Boxplot Help Needed Hi R-Experts, How can I show all the relevant measures like mean, median, min. value, max. value, outlier in a single boxplot diagram? Suppose I have a data set c(2,4,5,7,12,14,15,13,8,5,23,98,11) Sumanta Basak. [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Sumanta Basak wrote:> Hi R-Experts, > > > > How can I show all the relevant measures like mean, median, min. value, > max. value, outlier in a single boxplot diagram? > > > > Suppose I have a data set c(2,4,5,7,12,14,15,13,8,5,23,98,11)Your e-mail address suggests this is not a homework question? Please read the manuals and the posting guide. You will certainly find some experts who are willing to give an R course for your company, btw. In this case, reading ?boxplot should have helped: x <- c(2,4,5,7,12,14,15,13,8,5,23,98,11) boxplot(x) # we need to add the mean, as requested: points(1, mean(x), pch=16, col="red") Uwe Ligges> > > Sumanta Basak. > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
you mean that you want something like: x <- c(2,4,5,7,12,14,15,13,8,5,23,98,11) sx <- summary(x) boxplot(x) text(x = 1 - 0.3, y = seq(40, 70, length = 6), paste(names(sx), ": ", sx, sep = "")) I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://www.med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Sumanta Basak" <sumantab at ambaresearch.com> To: <r-help at stat.math.ethz.ch> Sent: Tuesday, March 07, 2006 10:54 AM Subject: [R] Boxplot Help Needed> Hi R-Experts, > > > > How can I show all the relevant measures like mean, median, min. > value, > max. value, outlier in a single boxplot diagram? > > > > Suppose I have a data set c(2,4,5,7,12,14,15,13,8,5,23,98,11) > > > > Sumanta Basak. > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm