as.data.frame.genalex: Convert class genalex to data frame

Description Usage Arguments Value Author(s) See Also Examples

Description

Convert an object of class genalex to a data frame, optionally removing all genalex-specific attributes. Note that the behaviour of stringsAsFactors will be used to determine whether to convert character columns in the data frame to factors during conversion. Note also that any extra columns are not affected by this conversion, as they are already stored in a data frame.

Usage

1
2
3
## S3 method for class 'genalex'
as.data.frame(x, ..., complete = FALSE,
  stringsAsFactors = default.stringsAsFactors())

Arguments

x

An object to convert to class 'data.frame'

complete

If TRUE, also removes class genalex-specific attributes

stringsAsFactors

Should character vectors be converted to factors? This could affect sample and population names.

...

Additional arguments passed to as.data.frame

Value

x as class 'data.frame'. With the default complete = FALSE, no attributes are removed, and the class is simply changed to data.frame and as.data.frame is called. With complete = TRUE, all genalex-specific attributes are removed.

Author(s)

Douglas G. Scofield

See Also

as.data.frame, data.frame, as.genalex

Examples

1
2
3
4
5
6
7
data(Qagr_adult_genotypes)
## leave genalex-specific attributes in place
dat <- as.data.frame(Qagr_adult_genotypes)
## remove genalex-specific attributes
dat.clean <- as.data.frame(Qagr_adult_genotypes, complete = TRUE)
## both should result in an identical data frame, though the
## data.file.name attribute will be different.

douglasgscofield/readGenalex documentation built on May 15, 2019, 10:43 a.m.