landscape.sample {rmetasim}R Documentation

simulates sampling for genetics on the landscape

Description

Randomly pulls a max of ns individuals from a max of np populations and returns a landscape object that could be used for further simulation, but is usually used for analyses and summary statistics calculatiuons. If one needs a sample of specific populations/habitats, then these should be given in the vector pvec

Usage

landscape.sample(rland, np = NULL, ns = NULL, pvec = NULL)

Arguments

rland landscape object
np number populations
ns number samples per population
pvec vector of population id numbers to sample

Value

landscape object

Examples

        l <- landscape.new.example()
        l <- landscape.simulate(l,1)
        l.samp <- landscape.sample(l,np=3,ns=24)
        landscape.amova.pairwise(l.samp)
        l.samp2 <- landscape.sample(l,ns=24,pvec=c(1,3))
        landscape.amova.pairwise(l.samp2) 

[Package rmetasim version 1.1.11 Index]