powered by
Instructional function, and possibly a utility function for some apps.
popsamp(n,pop,...)
number of items to sample
data frame, from which to sample n rows
other arguments passed to function
The sample, as a data frame.
# NOT RUN { data(imagpop) popsamp(10,imagpop) #Simple random sampling (no replacement) popsamp(10,imagpop,replace=TRUE) #Random sampling with replacement # }
Run the code above in your browser using DataLab