Learn R Programming

adegenet (version 2.0.0)

setPop: Manipulate the population factor of genind objects.

Description

The following methods allow the user to quickly change the population of a genind object.

Usage

setPop(x, formula = NULL)

setPop(x) <- value

Arguments

x
a genind or genlight object
formula
a nested formula indicating the order of the population strata.
value
same as formula

Examples

Run this code
data(microbov)

strata(microbov) <- data.frame(other(microbov))

# Currently set on just
head(pop(microbov))

# setting the strata to both Pop and Subpop
setPop(microbov) <- ~coun/breed
head(pop(microbov))

# Can be used to create objects as well.
microbov.old <- setPop(microbov, ~spe)
head(pop(microbov.old))

Run the code above in your browser using DataLab