to_genepop: Translates a 'data.frame'

View source: R/to_genepop.R

to_genepopR Documentation

Translates a data.frame

Description

This is a basic output file formatter for saving files necessary for saving output in textual formats.

Usage

to_genepop(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 as

Author(s)

Rodney J. Dyer <rjdyer@vcu.edu>

Examples

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)
gp <- to_genepop( pop )
cat(gp)

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