Learn R Programming

tagtools (version 0.2.0)

extract: Extract a sub-sample of data

Description

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

Usage

extract(x, sampling_rate, tst, ted)

Value

X: A matrix containing a sub-sample of x. X has the same number of columns as x. The length of the sub-sample will be round(sampling_rate*(tend-tstart)) samples.

Arguments

x

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

sampling_rate

the sampling rate in Hz of the data in x.

tst

Defines the start time in seconds of the interval to be extracted from x.

ted

Defines the end time in seconds of the interval to be extracted from x.

Examples

Run this code
BW <- beaked_whale
BW_subset <- extract(x = BW$A$data, sampling_rate = BW$A$sampling_rate, tst = 3, ted = 100)

Run the code above in your browser using DataLab