as.data.frame.gtypes: Convert 'gtypes' To 'data.frame'

Description Usage Arguments Value Author(s) See Also Examples

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, sort.alleles = 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)?

sort.alleles

logical. for non-haploid objects, should alleles be sorted in genotypes or left in original order? (only takes affect if one.col = TRUE)

...

additional arguments to be passed to or from methods.

Value

A data.frame with one row per sample.

Author(s)

Eric Archer [email protected]

See Also

df2gtypes as.matrix as.array

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)

strataG documentation built on May 29, 2017, 12:14 p.m.