Learn R Programming

dartR (version 1.1.11)

gl.write.csv: Write out data from a gl object adegenet to csv file

Description

This script writes to file the SNP genotypes with specimens as entities (columns) and loci as attributes (rows). Each row has associated locus metadata. Each column, with header of specimen id, has population in the first row.

Usage

gl.write.csv(gl, outfile = "outfile.csv", outpath = tempdir())

Arguments

gl

-- name of the genlight object containing SNP genotypes [required]

outfile

-- name of the csv file to write the data to [required]

outpath

-- path where to save the output file (set to tempdir by default)

Value

saves a glenlight object to csv

Details

The data coding differs from the DArT 1 row format in that 0 = reference homozygous, 2 = alternate homozygous, 1 = heterozyous, and NA = missing SNP assignment.

Examples

Run this code
# NOT RUN {
gl.write.csv(testset.gl, outfile="SNP_1row.csv")
# }

Run the code above in your browser using DataLab