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.
> 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 >
YourData[sample(209,106),] Regards Christian Mora -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Savano Sent: Monday, December 01, 2003 9:38 AM To: Lista R Subject: [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