Learn R Programming

pophelper (version 1.2.0)

runsToDfStructure: Convert STRUCTURE run files to R dataframes.

Description

Takes one or more STRUCTURE output files and converts each of them to separate dataframes.

Usage

runsToDfStructure(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 data frame. Spaces in labels may be replaced with _.

Value

If a single file is selected, a single dataframe is returned. If multiple files are selected, a list with multiple dataframes is returned. If individual labels are present in the STRUCTURE file, they are added to the dataframe as row names.

See Also

runsToDfTess, runsToDfMatrix

Examples

Run this code
# NOT RUN {
slist <- list.files(path=system.file("files/structure",package="pophelper"),full.names=TRUE)
#create a dataframe
runsToDfStructure(slist[1])

#use ind names from file
runsToDfStructure(slist[1],indlabfromfile=T)

#create a list of dataframes
runsToDfStructure(slist)
# }

Run the code above in your browser using DataLab