File: srswor1.R

package info (click to toggle)
r-cran-sampling 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,336 kB
  • sloc: ansic: 21; makefile: 2
file content (8 lines) | stat: -rw-r--r-- 118 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
"srswor1" <-
function(n,N)
{j=0
 s=numeric(N)
 for(k in 1:N) if(runif(1)<(n-j)/(N-k+1)) {j=j+1;s[k]=1;}
 s
}