Learn R Programming

camtrapR (version 3.1.0)

[.camOp: Subsetting method for camera trap station operation matrices

Description

Ensures that subsetting a camOp object (e.g. x[1:5, ], x[, 1:30]) retains the camOp class and its provenance attributes (stationCol, cameraCol, sessionCol, setupCol, retrievalCol). Unlike those, the from/to attributes are recomputed from the remaining column names (dates) rather than carried over unchanged, since they describe the date range actually covered by x and would otherwise go stale after column subsetting.

Usage

# S3 method for camOp
[(x, i, j, ..., drop)

Arguments

x

an object of class camOp

i

row index

j

column index

...

further arguments passed to or from other methods

drop

logical, whether to simplify to a vector when selecting a single row/column