srswor {sampling} | R Documentation |
Draw a simple random sampling without replacement of size n.
srswor(n,N)
n |
sample size. |
N |
population size. |
Return a vector (0 and 1) of size N which is the population size.
############ ## 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])