Learn R Programming

tagtools (version 0.2.0)

extract_cues: Extract multiple sub-samples of data

Description

This function is used to extract multiple sub-samples of data from a vector or matrix.

Usage

extract_cues(x, sampling_rate, cues, len)

Value

A list with 2 elements:

  • X: A matrix containing sub-samples of x. If x is a vector, X has as many columns as there are cues, i.e., each cue generates a column of X. If x is a pxm matrix, X will be a qxmxn matrix where n is the size of cues and q is the length of the interval requested, i.e., round(sampling_rate*len) samples.

  • cues: The list of cues actually used. cues that require data outside of x are rejected.

Arguments

x

is a vector or matrix of measurements. If x is a matrix, each column is treated as a separate measurement vector.

sampling_rate

is the sampling rate in Hz of the data in x.

cues

defines the start time in seconds of the intervals to be extracted from x.

len

is the length of the interval to extract in seconds. This should be a scalar.

Examples

Run this code
BW <- beaked_whale # beaked_whale must be in your working directory
list <- extract_cues(x = BW$A$data, sampling_rate = BW$A$sampling_rate, cues = c(6, 40), len = 11)

Run the code above in your browser using DataLab