Learn R Programming

dartR (version 1.1.11)

gl2structure: Converts genlight objects to STRUCTURE formated files

Description

This function exports genlight objects to STRUCTURE formatted files (be aware there is a gl2faststruture version as well). It is based on the code provided by Lindsay Clark (see https://github.com/lvclark/R_genetics_conv) and this function is basically a wrapper around her numeric2structure function. See also: Lindsay Clark. (2017, August 22). lvclark/R_genetics_conv: R_genetics_conv 1.1 (Version v1.1). Zenodo: http://doi.org/10.5281/zenodo.846816.

Usage

gl2structure(gl, indNames = NULL, addcolumns = NULL, ploidy = 2,
  exportMarkerNames = TRUE, outfile = "gl.str", outpath = tempdir(),
  v = 1)

Arguments

gl

-- genlight containing lat longs [required]

indNames

-- switch if individuals names should be added (defult to indNames in gl)

addcolumns

-- additional columns to be added before genotypes

ploidy

-- defaults to 2

exportMarkerNames

-- switch if loci names should be included (locNames(gl))

outfile

-- name (path) of the output shape file

outpath

-- path of the output file. Default is to tempdir(). If to be saved in the current working directory change to "."

v

-- verbosity: if v=0 no output, v=1 reports name and path of output file. default 1

Examples

Run this code
# NOT RUN {
gl2structure(testset.gl)
# }

Run the code above in your browser using DataLab