samp.within: Shuffles a sequence within groups defined by the input vector

Description Usage Arguments Value Author(s) References See Also Examples

Description

Used to generate a permutation of a sequence 1:length(lev). observations are permutted within blocks, according to the vector lev passed to the function.

Usage

1

Arguments

lev

a vector containing the group to which belongs the observations to be permuted.

Value

a vector 1:length(lev) (with blocks defined by

1
lev

) randomly permuted. Usually, one passes the result to reorder observations in a data set in order to carry out permutation-based tests.

Author(s)

Jerome Goudet, DEE, UNIL, CH-1015 Lausanne Switzerland

jerome.goudet@unil.ch

References

Goudet J. (2005). Hierfstat, a package for R to compute and test variance components and F-statistics. Molecular Ecology Notes. 5:184-186

See Also

samp.between,g.stats.glob.

Examples

1
2
samp.within(rep(1:4,each=4))
#for an application see example in g.stats.glob

hierfstat documentation built on Nov. 17, 2021, 5:08 p.m.