sortQ: Sort runs in a qlist based on an attribute

Description Usage Arguments Details Value Examples

View source: R/qlist.R

Description

Sort runs in a qlist based on an attribute

Usage

1
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

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=FALSE).

Value

A sorted qlist object

Examples

1
2
3
4
5
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)

royfrancis/pophelper documentation built on Jan. 1, 2021, 4:58 p.m.