View source: R/gl.add.indmetrics.r
gl.add.indmetrics | R Documentation |
This function adds the metadata information to the slot ind.metrics and populates population and coordinates information slots if the they are found in the metadata.
gl.add.indmetrics(x, ind.metafile, verbose = NULL)
x |
Name of the genlight object containing the SNP data, or the genind object containing the SilocoDArT data [required]. |
ind.metafile |
path and name of CSV file containing the metadata information for each individual (see details for explanation) [required]. |
verbose |
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2, unless specified using gl.set.verbosity]. |
The ind.metadata file needs to have very specific headings. First a column
with a heading named 'id'. Here the ids must match the ids in the genlight
object, e.g. indNames(your_genlight)
. The following column headings
are optional:
'pop' - specifies the population membership of each individual.
'lat' - latitude coordinates (in decimal degrees WGS1984 format).
'lon' - longitude coordinates (in decimal degrees WGS1984 format).
Additional columns with individual metadata can be imported (e.g. age, sex, etc).
A genlight object with metadata information for each individual.
Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr
dartfile <- system.file('extdata','testset_SNPs_2Row.csv', package='dartR.data')
metadata <- system.file('extdata','testset_metadata.csv', package='dartR.data')
gl <- gl.read.dart(dartfile, probar=TRUE)
gl <- gl.add.indmetrics(gl, ind.metafile = metadata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.