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

View source: R/partition.R

partitionR Documentation

Subdivide a data.frame of genetic information, into a list of substrata

Description

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

Usage

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

 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")

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.