writeGenalexExcel: Write GenAlEx-format genotypes to an Excel worksheet

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Writes genotype data file in GenAlEx format from an annotated data frame of class genalex to an Excel worksheet. Both .xls and .xlsx formats may be written. This function uses the function writeWorksheet and others from the XLConnect package to write the Excel file. Strings representing NA values are strictly those allowed by GenAlEx itself, 0 and -1. The worksheet is written using the default formatting of the XLConnect package.

Usage

1
2
writeGenalexExcel(x, file, worksheet, na = c("0", "-1"), na.character = "",
  check.annotation = TRUE, overwrite = FALSE)

Arguments

x

Annotated data frame of class genalex

file

Excel workbook file to which to write the worksheet

worksheet

Worksheet name in a format valid for Excel, see createSheet

na

The string to use when writing missing values in genotype data. Defaults to "0", and must be one of "0" or "-1", as allowed by GenAlEx.

na.character

The string to use when writing missing values in character data. Defaults to "".

check.annotation

If TRUE, the annotations for the dataset are checked using is.genalex(x, force = TRUE, skip.strings = TRUE). If that returns FALSE, nothing is written and an error is generated.

overwrite

If FALSE, an existing sheet with the same name as worksheet will not be overwritten, if TRUE it will be.

Details

Only the first column for each locus is given a heading, specifically the locus name. The other columns representing further alleles for the locus are left blank.

Any extra columns of data, if present in the object of class genalex, are written immediately to the right of the genotype columns.

For further information and cautions, see writeGenalex.

Value

No value is returned.

Author(s)

Douglas G. Scofield

References

Peakall, R. and Smouse P.E. (2012) GenAlEx 6.5: genetic analysis in Excel. Population genetic software for teaching and research-an update. Bioinformatics 28, 2537-2539.

Peakall, R. and Smouse P.E. (2006) GENALEX 6: genetic analysis in Excel. Population genetic software for teaching and research. Molecular Ecology Notes 6, 288-295.

See Also

readGenalexExcel, writeGenalex, writeWorksheet createSheet

Examples

1
2
3
4
5
6
data(Qagr_adult_genotypes)
d <- head(Qagr_adult_genotypes)
## recalculate class attributes
d <- as.genalex(d, force = TRUE)
## create Excel worksheet, will not overwrite existing
writeGenalexExcel(d, "test.xlsx", "test")

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