[R] Question about R
jrkrideau at yahoo.ca
Thu Apr 5 12:55:37 CEST 2007
nams <- c(rep("a",10), rep("b",10))
table(sample(nams, 5, replace = TRUE))
--- Chia-Yi Tseng <tseng_chiayi at yahoo.com> wrote:
> I would like to ask how can I do the problem as
> follows by R. Thank you very much.
> Q: Create a list of twenty distinct first names,
> ten male and ten female, and store them into an
> array. Write a routine for selecting a simple random
> sample of five names and counts the number of male
> and female names in the sample when the sample is
> drawn :
> (a) with replacement
> (b) without replacement
> Finding fabulous fares is fun.
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained,
> reproducible code.
More information about the R-help