Re: [R] Add lines to density plot

From: Romain Francois <francoisromain_at_free.fr>
Date: Sat 17 Sep 2005 - 01:22:18 EST

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    ~~~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~

______________________________________________
R-help@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
Received on Wed Sep 21 02:38:17 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 17:21:25 EST