sample.systematic: take (a) systematic sample(s) from a vector

View source: R/sample.systematic.r

sample.systematicR Documentation

take (a) systematic sample(s) from a vector

Description

take (a) systematic sample(s) from a vector

Usage

sample.systematic(N, n = NA, exact_n = T, as_idx = T)

Arguments

N

vector length

n

length of sample (optionally a vector of samples)

exact_n

should n be matched exactly

as_idx

should a numeric index be return (T) or T/F vector (F)

Details

This program is free software but it is provided WITHOUT WARRANTY and with ABSOLUTELY NO GUARANTEE of fitness or functionality for any purpose; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.


Revision History

1.0 7/13/2021 Implemented
1.1 date and revisions..

Value

vector of numeric indices or T/F vector of length N vector of 0's (not sampled) and group ids 1:n for sampled items if length(n) > 1

Author(s)

Jacob Strunk <Jacob.strunk@usda.gov>

See Also

sample
which

Examples


 sample.systematic(2000, 25)
 sample.systematic(205, n=c(50,50))



jstrunk001/RSForInvt documentation built on April 18, 2022, 11:03 p.m.