to_structure: Translates a 'data.frame' with loci into a textual STRUCTURE...

Description Usage Arguments Value Author(s) Examples

View source: R/to_structure.R

Description

This is a basic converter that takes a data.frame with locus objects in it and returns a textual representation as a STRUCTURE input file.

Usage

1
to_structure(df, stratum = "Population")

Arguments

df

The data.frame to be written to the output.

stratum

The stratum to use as "POP" (default="Population")

Value

A string representation of the data.frame formatted for STRUCTURE

Author(s)

Rodney J. Dyer <rjdyer@vcu.edu>

Examples

1
2
3
4
5
6
7
8
A <- locus( c("1","1"))
B <- locus( c("1","2"))
C <- locus( c("2","2"))
loc1 <- c( A, A, B, B, B, B, C, C)
loc2 <- c( A, B, B, C, A, B, A, C)
pop <- data.frame( Population=c( rep("A",4),rep("B",4) ), loc1, loc2)
st <- to_structure( pop )
cat(st)

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