simple_rs_probabilities: Inclusion Probabilities: Simple Random Sampling

Description Usage Arguments Value Examples

View source: R/simple_rs.R

Description

Inclusion Probabilities: Simple Random Sampling

Usage

1
2

Arguments

N

The number of units. N must be a positive integer. (required)

prob

prob is the probability of being sampled must be a real number between 0 and 1 inclusive, and must be of length 1. (optional)

prob_unit

prob is the probability of being sampled must be a real number between 0 and 1 inclusive, and must be of length N. (optional)

check_inputs

logical. Defaults to TRUE.

Value

A vector length N indicating the probability of being sampled.

Examples

1
2
3
4
5
probs <- simple_ra_probabilities(N = 100)
table(probs)

probs <- simple_ra_probabilities(N = 100, prob = 0.3)
table(probs)

acoppock/randomizr documentation built on Dec. 8, 2018, 7:53 a.m.