as_tibble.AsspDataObj: Convert an AsspDataObj to a tibble

View source: R/ssff.R

as_tibble.AsspDataObjR Documentation

Convert an AsspDataObj to a tibble

Description

This function converts an AsspDataObj to tibble::as_tibble form.

Usage

## S3 method for class 'AsspDataObj'
as_tibble(x, field = NULL, beginTime = NULL, endTime = NULL, na.zeros = TRUE)

Arguments

x

An object of class AsspDataObj (usually created by calling read.AsspDataObj)

field

An optional argument indicating either the field name or field index number to extract. If not given (NULL), all fields will be extracted.

na.zeros

Replace all zero (0) values in the track data columns with NA value? Defaults to TRUE so that subsequent applications of summary statistics functions do not risk confusing the zero values as actual measurements.

start

The start time of the portition of the SSFF track that was converted to a tibble. Defaults to zero (0) which means that the extracted portion is expected to start at the beginning of the signal.

Details

This function redefines the tibble::as_tibble method for AsspDataObj so that the output columns works well with reindeer::quantify and to replicate the output of emuR::get_trackdata.

Contrary to emuR::get_trackdata this function assumes that track data that are exactly zero (0) are actually missing measurements, acknowleging that this is how missing measurements are stored in the SSFF file format. The user should supply an argument na.zeros=FALSE if that assumption is risky in the SSFF file that is processed.

Value

A tibble::tibble containing columns timed_orig, times_rel, times_norm, followed by one column for each track and track field (separated by '_') that is, if the user has chosen to convert the output of forest to a tibble, then the tibble will have columns ⁠times_orig times_rel times_norm fm_1 fm_2 fm_3 fm_4 bw_1 bw_2 bw_3 bw_4⁠. If the user only wanted the first field (or the "fm" field), then the output tibble will have columns ⁠times_orig times_rel times_norm fm_1 fm_2 fm_3 fm_4⁠.


humlab-speech/superassp documentation built on May 8, 2024, 2:27 p.m.