[R-sig-genetics] Subsetting a genind object.
Daniel Schmidt
d.schmidt at griffith.edu.au
Thu Feb 2 01:22:21 CET 2017
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:
> 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.
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-genetics mailing list
> R-sig-genetics at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-genetics
>
--
Dr. Daniel J. Schmidt
Research Fellow, Australian Rivers Institute
Griffith University 170 Kessels Road, Nathan
Brisbane QLD 4111 Australia
d.schmidt at griffith.edu.au
Office: +61 7 37354165
http://www.rivers.edu.au
[[alternative HTML version deleted]]
More information about the R-sig-genetics
mailing list