signalmatrix {secr} | R Documentation

## Reformat Signal Data

### Description

Produce sound x microphone matrix, possibly with sound covariates as extra columns.

### Usage

    signalmatrix(object, noise = FALSE, recodezero = FALSE,
        prefix = "Ch", signalcovariates = NULL, names = NULL)

### Arguments

`object` | object inheriting from secr class ‘capthist’
`noise` | logical; if TRUE, noise is extracted instead of signal
`recodezero` | logical; if TRUE zero signals are set to NA
`prefix` | character value used to form channel names
`signalcovariates` | character vector of covariate names from signalframe to add as columns
`names` | character vector of column names

### Details

This function extracts signal or noise data from a capthist object, where it is stored in the ‘signalframe’ attribute, as a more natural sound x microphone table. There is no equivalent replacement function.

The `signalcovariates` argument may be used to specify additional columns of the signal frame to collapse and add as columns to the right of the actual signal data. Ordinarily there will be multiple rows in signalframe for each row in the output; the covariate value is taken from the first matching row.

If `names` is not provided, column names are constructed from the detector names. If the length of `names` is less than the number of columns, simple numerical names are constructed.

### Value

A dataframe with dim = c(n,K+j) where n is the number of separate sounds, K is the number of microphones, and j is the number of covariates (by default j = 0).

### See Also

`ovensong`

### Examples

    ## use 'secr' ovenbird data
    signalmatrix(signalCH)

[Package secr version 3.2.1 Index]