AW: [R] Sampling

RINNER Heinrich H.RINNER at tirol.gv.at
Mon Dec 1 14:07:47 CET 2003


Hi,

you can use something like

> example.data <- data.frame(x=rnorm(209), y=rnorm(209))
> selected.sample <- example.data[sample(209,106), ]

See ?sample.

-Heinrich.

> -----Ursprüngliche Nachricht-----
> Von: Savano [mailto:savano at superig.com.br] 
> Gesendet: Montag, 01. Dezember 2003 13:38
> An: Lista R
> Betreff: [R] Sampling
> 
> 
> 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?
> 
> 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