pophelper (version 2.3.0)

sortQ: Sort runs in a qlist based on an attribute

Description

Sort runs in a qlist based on an attribute

Usage

sortQ(qlist, by = "k", decreasing = FALSE, debug = FALSE)

Arguments

qlist

A qlist object

by

A valid attribute name. Generally 'k' or 'ind'. Structure runs can take loci, burin, reps etc. Can take more than one name to arrange by multiple fields. For example by=c("ind","k"). See details.

decreasing

A logical indicating the direction of sorting.

debug

Logical for internal use

Value

A sorted qlist object

Details

Argument 'by' can be any attribute name returned by sapply(qlist,attributes) except 'names', 'class' and 'row.names'. This is usually similar to tabulateQ(qlist,sorttable=F).

Examples

Run this code
# NOT RUN {
sfiles <- list.files(path=system.file("files/structure",package="pophelper"), full.names=TRUE)
slist <- readQ(sfiles)
slist_1 <- sortQ(slist)
names(slist)
names(slist_1)

# }

Run the code above in your browser using DataCamp Workspace