Learn R Programming

popprxl (version 0.1.4)

read.genalexcel: Read GenAlEx formatted data from excel

Description

The poppr function read.genalex provides a way to read GenAlEx formatted data into R. The only stipulation is that the file must be saved as a CSV text file beforehand. This function provides a wrapper for read.genalex and read_excel from the readxl package.

Usage

read.genalexcel(x, sheet = 1, ...)

Arguments

x

a path to your excel file

sheet

the sheet in which your data is contained.

...

any arguments to be passed on to read.genalex

Value

a genclone or genind object.

See Also

read.genalex

Examples

Run this code
# NOT RUN {
# Read in the data set nancycats from an example excel file in this
# package.

nancy <- system.file("files/nancycats.xlsx", package = "popprxl")
nancy # This is the address to our excel file.
read.genalexcel(nancy, sheet = 1, genclone = FALSE)

# Note that system.file() is only for examples. You can use
# file.choose() for an interactive way of choosing files.
#
# e.g.
# myfile <- file.choose()
# read.genalexcel(myfile)
# }
# NOT RUN {
nancy_ex_rows <- system.file("files/nancycats_extra_rows.xlsx", package = "popprxl")
# This will give a warning
read.genalexcel(nancy_ex_cols, sheet = 1, genclone = FALSE)
# }

Run the code above in your browser using DataLab