Learn R Programming

dartR (version 0.80)

read.dart: Import DarT data to R

Description

Import DarT data to R

Usage

read.dart(filename, nas = "-", topskip = NULL, stdmetrics = c("AlleleID",
  "SNP", "SnpPosition", "RepAvg", "CallRate", "AvgCountRef", "AvgCountSnp",
  "FreqHomRef", "FreqHomSnp", "FreqHets", "OneRatioSnp"), addmetrics = NULL,
  lastmetric = "RepAvg")

Arguments

filename

path to file (csv file only currently)

nas

a character specifying NAs (default is "-")

topskip

a number specifying the number of rows to be skipped. If not provided the number of rows to be skipped are "guessed" by the number of rows with "*" at the beginning.

stdmetrics

a vector of column headings that are extracted. AlleleID and its format is compulsory, the rest are needed for filtering.

addmetrics

add additional headers/columns by name

lastmetric

specifies the last non genetic column (Default is "RepAvg"). Be sure to check if that is true, otherwise the number of individuals will not match. You can also specify the last column by a number.

Value

a list of length 5. #dart format (one or two rows) #individuals, #snps, #non genetic metrics, #genetic data (still two line format, rows=snps, columns=individuals)

Examples

Run this code
# NOT RUN {
{
dartfile <- system.file("extdata","testset_SNPs_2Row.csv", package="dartR")
dart <-read.dart(dartfile)
}
# }

Run the code above in your browser using DataLab