biopac_hdf5_to_dataframe: Read a BIOPAC hdf5 file as a data.frame

View source: R/physio_functions.R

biopac_hdf5_to_dataframeR Documentation

Read a BIOPAC hdf5 file as a data.frame

Description

After converting an acq file using acq2hdf5, this function converts the hdf5 file to a data.frame

Usage

biopac_hdf5_to_dataframe(
  hdf5file,
  upsample_to_max = TRUE,
  ttl_to_dec = TRUE,
  ttl_columns = NULL
)

Arguments

hdf5file

HDF5 file containing converted BIOPAC data (using acq2hdf5)

upsample_to_max

logical (TRUE/FALSE) indicating whether to upsample slower channels to the sampling rate of the fastest channel. If TRUE, upsampling is performed on slower channels through linear interpolation. If FALSE, NA values are inserted for unsampled time points.

ttl_to_dec

logical indicating whether to convert binary digital input channels to decimal TTL (parallel port) codes. These codes are used to synchronize timing between behavioral and physiological data streams.

ttl_columns

A numeric vector or character vector indicating which columns within the imported dataset contain the digital inputs that should be converted to decimal TTL codes. If not specified, channels starting with Digital.input will be used. There should be exactly 8 channels for a 1-byte (0-255) TTL code.

Details

This function uses the data.table package to build the data.frame of physiological data because this package is particularly good at working with large datasets without a lot of copy-in-memory steps that can slow down processing and explode the peak RAM demand.

The function also supports upsampling of all data onto the same time resolution as the fastest sampling rate for any channel. This is governed by the upsample_to_max argument


PennStateDEPENdLab/experiment.pipeline documentation built on April 14, 2024, 9:37 p.m.