readGenalexExcel: Read GenAlEx-format genotypes from an Excel worksheet

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

Description

Reads genotype data file in GenAlEx format from an Excel worksheet into an annotated data frame of class genalex. Both .xls and .xlsx formats may be read. The same consistency checks are performed as for readGenalex. This function uses the function readWorksheetFromFile from the XLConnect package to read the Excel file. Strings representing NA values are strictly those allowed by GenAlEx itself, 0 and -1.

Usage

1
readGenalexExcel(file, worksheet, ploidy = 2)

Arguments

file

Excel workbook file from which to read the worksheet

worksheet

Worksheet specification in a format accepted by readWorksheetFromFile, specifically the worksheet name, as a character string, or an integer value indicating the worksheet position in the workbook, e.g., 1, 2, etc.

ploidy

The ploidy of genotypes encoded in worksheet (defaults to 2)

Details

This function is provided as a convenience to the user. If there are incompatibilities when reading GenAlEx-format data with this function, it is recommended to export the worksheet from Excel as tab-delimited text and read it with readGenalex.

Value

An annotated data frame of class genalex. The format is described in more detail in readGenalex. The "data.file.name" attribute is set to the value "file(worksheet)".

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

readGenalex, readWorksheetFromFile

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
xl.file <- system.file("extdata/Qagr_genotypes.xlsx",
                       package = "readGenalex")
## this could take ~5 sec or longer
gt <- readGenalexExcel(xl.file, worksheet = "Qagr_pericarp_genotypes")
head(gt)
names(attributes(gt))

## End(Not run)

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