Convert gtypes To data.frame

Description

Create a data.frame from a gtypes object.

Usage

1
2
3
## S4 method for signature 'gtypes'
as.data.frame(x, one.col = FALSE, sep = "/",
  ids = TRUE, strata = TRUE, ...)

Arguments

x

a gtypes object.

one.col

logical. If TRUE, then result has one column per locus.

sep

character to use to separate alleles if one.col is TRUE.

ids

logical. include a column for individual identifiers (ids)?

strata

logical. include a column for current statification (strata)?

...

additional arguments ot be passed to or from methods.

Value

A data.frame with one row per sample.

Author(s)

Eric Archer eric.archer@noaa.gov

See Also

df2gtypes as.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(msats.g)

# with defaults (alleles in multiple columns, with ids and stratification)
df <- as.data.frame(msats.g)
str(df)

# one column per locus
onecol.df <- as.data.frame(msats.g, one.col = TRUE)
str(onecol.df)

# just the genotypes
genotypes.df <- as.data.frame(msats.g, one.col = TRUE, ids = FALSE, strata = FALSE)
str(genotypes.df)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.