Sampling From a Population
Instructional function, and possibly a utility function for some apps.
popsamp(n,pop,...)
n
: number of items to samplepop
: data frame, from which to sample n rowsThe sample, as a data frame.
data(imagpop) popsamp(10,imagpop) #Simple random sampling (no replacement) popsamp(10,imagpop,replace=TRUE) #Random sampling with replacement
Homer White hwhite0@georgetowncollege.edu
Useful links