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.
gl2structure(gl, indNames = NULL, addcolumns = NULL, ploidy = 2,
exportMarkerNames = TRUE, outfile = "gl.str", outpath = tempdir(),
v = 1)
-- genlight containing lat longs [required]
-- switch if individuals names should be added (defult to indNames in gl)
-- additional columns to be added before genotypes
-- defaults to 2
-- switch if loci names should be included (locNames(gl))
-- name (path) of the output shape file
-- path of the output file. Default is to tempdir(). If to be saved in the current working directory change to "."
-- verbosity: if v=0 no output, v=1 reports name and path of output file. default 1
# NOT RUN {
gl2structure(testset.gl)
# }
Run the code above in your browser using DataLab