Read GenAlEx formatted data from excel

Share:

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

1
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.

Author(s)

Zhian N. Kamvar

See Also

read.genalex

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# 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)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.