Re: [R] Question about R

From: John Kane <jrkrideau_at_yahoo.ca>
Date: Thu 05 Apr 2007 - 10:55:37 GMT


?sample
nams <- c(rep("a",10), rep("b",10))
table(sample(nams, 5, replace = TRUE))

> Hi,
>
> 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@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
> and provide commented, minimal, self-contained,
> reproducible code.
>



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 and provide commented, minimal, self-contained, reproducible code. Received on Thu Apr 05 21:06:07 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 05 Apr 2007 - 11:30:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.