Skip to content

Subsetting a genind object.

2 messages · Nevil Amos, Daniel Schmidt

#
Is there a convenient way to subset a genind object using a vector of the
subset of individuals at one pass ( so that it correctly subsets  genotype
table, individuals, populations, XY coordinates etc?)

effective  working on the genind object as

data.frame[SubsetVector,] would on a data frame?

I realist that I can do this for each component of the object in turn but
thought there was a faster method that I cannot now find.

thanks.
#
If your genind object is g, then:
g <- g[i=c(1:10,21:30)]
would give you a new genind g, with individual indexes 1 to 10 and 21 to
30. All other associated info (tab, pop etc) comes along for the ride.
If that's what you're after...
On Thu, Feb 2, 2017 at 9:53 AM, nevil amos <nevil.amos at gmail.com> wrote: