Learn R Programming

dartR (version 0.80)

dart2genlight: Convert DarT to genlight

Description

converts a dart file (read via read.dart) into an genlight object adegenet

Usage

dart2genlight(dart, covfilename = NULL, probar = TRUE)

Arguments

dart

a dart object created via read.dart

covfilename

optional file in csv format with covariates for each individual (see details for explanation)

probar

show progress bar

Value

a genlight object is returned. Including all available slots are filled. loc.names, ind.names, pop, lat, lon (if provided via the covariate file)

Details

the covariate file needs to have very specific headings. First an heading called id. Here the ids have to match the ids in the dart object colnames(dart[[4]]). The following column headings are optional. pop: specifies the population membership of each individual. lat and lon specify spatial coordinates (perferable in decimal degrees WGS1984 format). Additional columns with individual covariates can be imported (e.g. age, gender).

Examples

Run this code
# NOT RUN {
dgl <- dart2genlight(dart, "covariates.csv")
# }

Run the code above in your browser using DataLab