popsamp {tigerstats}R Documentation

Sampling From a Population

Description

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

Usage

popsamp(n,pop,...)

Arguments

n

number of items to sample

pop

data frame, from which to sample n rows

...

other arguments passed to function

Value

The sample, as a data frame.

Author(s)

Homer White hwhite0@georgetowncollege.edu

Examples

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

[Package tigerstats version 0.3.2 Index]