population-methods: Manipulate the population factor of genind objects.

Description Usage Arguments Author(s) Examples

Description

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

Usage

1
2
3
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

Author(s)

Zhian N. Kamvar

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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))

## Not run: 

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

## End(Not run)

adegenet documentation built on Oct. 10, 2021, 1:09 a.m.