Learn R Programming

dartR (version 1.1.11)

gl.edit.recode.ind: Create or edit a individual (=specimen) names and create an recode_ind file

Description

A script to edit individual names in a genlight object, or to create a reassignment table taking the individual labels from a genlight object, or to edit existing individual labels in an existing recode_ind file.

Usage

gl.edit.recode.ind(gl, ind.recode = NULL, recalc = TRUE,
  mono.rm = TRUE, v = 1)

Arguments

gl

Name of the genlight object for which individuals are to be relabelled.[required]

ind.recode

Name of the file to output the new assignments [optional]

recalc

-- Recalculate the locus metadata statistics [default TRUE]

mono.rm

-- Remove monomorphic loci [default TRUE]

v

-- v=0, silent; v=1, low verbosity; v=2, high verbosity [default 1]

Value

An object of class ("genlight") with the revised individual labels

Details

Renaming individuals may be required when there have been errors in labelling arising in the process from sample to DArT files. There may be occasions where renaming individuals is required for preparation of figures. Caution needs to be exercised because of the potential for breaking the "chain of evidence" between the samples themselves and the analyses. Recoding individuals can also be done with a recode table (csv).

This script will input an existing recode table for editting and optionally save it as a new table, or if the name of an input table is not supplied, will generate a table using the individual labels in the parent genlight object.

The script, having deleted individuals, optionally identifies resultant monomorphic loci or loci with all values missing and deletes them (using gl.filter.monomorphs.r). The script also optionally recalculates statistics made redundant by the deletion of individuals from the dataset.

The script returns a genlight object with the new individual labels and the recalculated locus metadata.

Examples

Run this code
# NOT RUN {
gl <- gl.edit.recode.ind(testset.gl)
gl <- gl.edit.recode.ind(testset.gl, ind.recode="ind.recode.table.csv")
gl <- gl.edit.recode.ind(testset.gl, ind.recode="ind.recode.table.csv")
# }
# NOT RUN {
#Ammended Georges 9-Mar-17
# }

Run the code above in your browser using DataLab