partition: Subdivide a 'data.frame' of genetic information, into a list...

Description Usage Arguments Value Note Author(s) Examples

View source: R/partition.R

Description

This function allows you to take a single Population object into a list of Population objects, one for each stratum.

Usage

1
partition(x, stratum = "Population")

Arguments

x

Any object that can be column indexed by the function names

stratum

The column name of the stratum to partition on (default='Population').

Value

A partitioned list of objects, indexed by name

Note

A quick routine for grabbing subsets of data.

Author(s)

Rodney J. Dyer rjdyer@vcu.edu

Examples

1
2
3
4
5
6
7
8
 AA <- locus( c("A","A") )
 AB <- locus( c("A","B") )
 BB <- locus( c("B","B") )
 locus <- c(AA,AA,AA,AA,BB,BB,BB,AB,AB,AA)
 Population <- c(rep("Pop-A",5),rep("Pop-B",5))
 locus2 <- c(AB,BB,AA,BB,BB,AB,AB,AA,AA,BB)
 df <- data.frame( Population, TPI=locus, PGM=locus2 )
 partition(df, stratum="Population")

MarianaLag/Mlag documentation built on Feb. 13, 2020, 12:30 a.m.