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

View source: R/sampleSystematic.R

sampleSystematicR Documentation

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

Description

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

Usage

sampleSystematic(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 <someone@somewhere.com>

See Also

sample
which

Examples


 sampleSystematic(2000, 25)
 sampleSystematic(205, n=c(50,50))



jstrunk001/RForInvt documentation built on April 17, 2025, 5:02 p.m.