sort: Sort Rows of capthist or mask Object

Description Usage Arguments Details Value See Also Examples

Description

Rows are sorted by fields in covariates or by a provided sort key of length equal to the number of rows.

Usage

1
2
3
4
5
6
7
## S3 method for class 'capthist'
sort(x, decreasing = FALSE, by = "",
    byrowname = TRUE,...)

## S3 method for class 'mask'
sort(x, decreasing = FALSE, by = "",
    byrowname = TRUE,...)

Arguments

x

capthist object

decreasing

logical. Should the sort be increasing or decreasing?

by

character vector (names of covariates) or data frame whose columns will be used as sort keys

byrowname

logical. Should row name be used as a final sort key?

...

other arguments (not used)

Details

For multi-session capthist objects only the named covariate form is suitable as the number of rows varies between sessions.

If requested, rows are sorted by rowname within by. The effect of the defaultsis to sort by rowname.

The attribute markingpoints of a mask object is removed if present, as it is no longer meaningful.

Value

capthist or mask object with sorted rows; any relevant attributes are also sorted (covariates, signal, xy)

See Also

capthist

Examples

1
2
3
sort(ovenCH, by = "Sex")
covariates(ovenCH)[["2005"]]
covariates(sort(ovenCH, by = "Sex"))[["2005"]]

secr documentation built on Dec. 3, 2017, 5:03 p.m.