Learn R Programming

pophelper (version 2.0.0)

readQStructure: Convert STRUCTURE run files to qlist.

Description

Takes one or more STRUCTURE run files and converts them to a list of dataframes.

Usage

readQStructure(files = NULL, indlabfromfile = FALSE)

Arguments

files

A character or character vector of one or more STRUCTURE run files. Use choose.files(multi=TRUE) to select interactively.

indlabfromfile

A logical indicating if individual labels must be read from input file and used as row names for resulting dataframe. Spaces in labels may be replaced with _.

Value

A list of lists with dataframes is returned. If individual labels are present in the STRUCTURE file, they are added to the dataframe as row names. Structure metadata including loci, burnin, reps, elpd, mvll, and vll is added as attributes to each dataframe. List items are named by input filenames.

Examples

Run this code
# NOT RUN {
sfiles <- list.files(path=system.file("files/structure",package="pophelper"),full.names=TRUE)
#create a qlist of all runs
slist <- readQStructure(sfiles)

#use ind names from file
readQStructure(sfiles[1],indlabfromfile=T)

#access the first run
readQStructure(sfiles)[[1]]

#access names of runs
names(slist)
#@export

# }

Run the code above in your browser using DataLab