Create a new dataset with specified populations or exclude specified populations from the dataset.
Arguments
- gid
- sublist
a
vector
of population names or indexes that the user wishes to keep. Default to"ALL"
.- exclude
a
vector
of population names or indexes that the user wishes to discard. Default toNULL
.- blacklist
DEPRECATED, use exclude.
- mat
a
matrix
object produced bymlg.table
to be subsetted. If this is present, the subsetted matrix will be returned instead of the genind object- drop
logical
. IfTRUE
, unvarying alleles will be dropped from the population.
Examples
# Load the dataset microbov.
data(microbov)
# List the population names.
popNames(microbov)
#> [1] "Borgou" "Zebu" "Lagunaire" "NDama"
#> [5] "Somba" "Aubrac" "Bazadais" "BlondeAquitaine"
#> [9] "BretPieNoire" "Charolais" "Gascon" "Limousin"
#> [13] "MaineAnjou" "Montbeliard" "Salers"
# Analyze only the populations with exactly 50 individuals
mic.50 <- popsub(microbov, sublist=c(1:6, 11:15), exclude=c(3,4,13,14))
# \dontrun{
# Analyze the first 10 populations, except for "Bazadais"
mic.10 <- popsub(microbov, sublist=1:10, exclude="Bazadais")
# Take out the two smallest populations
micbig <- popsub(microbov, exclude=c("NDama", "Montbeliard"))
# Analyze the two largest populations
miclrg <- popsub(microbov, sublist=c("BlondeAquitaine", "Charolais"))
# }