Learn R Programming

dartR (version 1.1.11)

gl.make.recode.pop: Create a proforma recode_pop_table file for reassigning population names

Description

Renaming populations may be required when there have been errors in assignment arising in the process from sample to DArT files or when one wishes to amalgamate populations, or delete populations. Recoding populations can also be done with a recode table (csv).

Usage

gl.make.recode.pop(x, outfile = "recode_pop_table.csv",
  outpath = tempdir())

Arguments

x

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

outfile

-- name of the new proforma file [default recode_pop_table.csv]

outpath

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

Value

A vector containing the new population names

Details

This script facilitates the construction of a recode table by producing a proforma file with current population names in two identical columns. Edit the second column to reassign populations. Use keyword Delete to delete a population.

Apply the recoding using gl.recode.pop().

Examples

Run this code
# NOT RUN {
result <- gl.make.recode.pop(testset.gl, outfile="Emmac_recode_pop.csv")
# }

Run the code above in your browser using DataLab