An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20050916/75b39a93/attachment.pl
Add lines to density plot
2 messages · xpRt.wannabe, Romain Francois
Le 16.09.2005 17:11, xpRt.wannabe a ??crit :
Dear List, I am using R to learn bootstrapping concepts. Not to be oblivious to the contributed packages of boot and bootstrap, I have opted to do the following as a way to hone my R skills. One example I am trying to work through is the following: x <- 1:20 Observed <- sample(x,20) Resamples <- replicate(1000,sample(Observed,replace=TRUE)) Boot.Means <- apply(Resamples,2,mean) plot(density(Boot.Means)) For the life of me, I can't seem to figure out how to add two lines to the density plot: 1. A line that represents the mean of Boot.Means 2. A line that represents the mean of Observed
R> abline(v=mean(Boot.Means))
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ~~~~~~ Romain FRANCOIS - http://addictedtor.free.fr ~~~~~~ ~~~~ Etudiant ISUP - CS3 - Industrie et Services ~~~~ ~~ http://www.isup.cicrp.jussieu.fr/ ~~ ~~~~ Stagiaire INRIA Futurs - Equipe SELECT ~~~~ ~~~~~~ http://www.inria.fr/recherche/equipes/select.fr.html ~~~~~~ ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~