[R] Sampling

paradis@univ-montp2.fr paradis at univ-montp2.fr
Mon Dec 1 13:54:34 CET 2003


> UseRs,
> 
> I imported a table using "read.table". It has 209 observations, I want to
> select a sample with 106 observations.  What function I use?

sample(), of course. See the help page (?sample) for the details and the options (with or without replacement). I guess you want something like:

DF[sample(1:209, 106), ]

where DF is your imported table.


Emmanuel Paradis
 
> thanks.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>




More information about the R-help mailing list