Learn R Programming

sampling (version 0.1)

srswor: Simple random sampling without replacement

Description

Draw a simple random sampling without replacement of size n.

Usage

srswor(n,N)

Arguments

n
sample size.
N
population size.

Details

Return a vector (0 and 1) of size N which is the population size.

See Also

sample, srswr

Examples

Run this code
############
## Example 1
############
#select a sample
srswor(3,10)
############
## Example 2
############
data(belgianmunicipalities)
Tot=belgianmunicipalities$Tot04
name=belgianmunicipalities$Commune
n=200
#select a sample
s=srswor(n,length(Tot))  
as.vector(name[s==1])

Run the code above in your browser using DataLab