popsamp function

Sampling From a Population

Sampling From a Population

Instructional function, and possibly a utility function for some apps.

popsamp(n,pop,...)

Arguments

  • n: number of items to sample
  • pop: data frame, from which to sample n rows
  • ``: other arguments passed to function

Returns

The sample, as a data frame.

Examples

data(imagpop) popsamp(10,imagpop) #Simple random sampling (no replacement) popsamp(10,imagpop,replace=TRUE) #Random sampling with replacement

Author(s)

Homer White hwhite0@georgetowncollege.edu

  • Maintainer: Homer White
  • License: GPL (>= 3)
  • Last published: 2020-06-15

Useful links