sample_binfile: Sample Bin File

View source: R/sample_binfile.R

sample_binfileR Documentation

Sample Bin File

Description

Sample Bin File

Usage

sample_binfile(
  binfile,
  binfile_path,
  output_folder,
  start_time = NULL,
  end_time = NULL,
  downsample = TRUE,
  output_csv = FALSE
)

Arguments

binfile

Text lines read from an open connection to a bin file.

binfile_path

Path to the bin file to be processed.

output_folder

Path to the folder containing GENEAcore run outputs and Measurement Period Information (MPI) files.

start_time

Time stamp to start the read from, default start of file.

end_time

Time stamp to end the read from, default end of file.

downsample

Logical to determine whether to downsample the file, default TRUE.

output_csv

Allow outputs of bin file sampling to be saved as CSV.

Details

Function to read in a GENEActiv bin file with option to downsample to 1Hz.

Value

List of 1Hz downsampled data or raw sample data.

Examples

binfile_path <- system.file("inst/extdata/20Hz_file.bin", package = "GENEAcore")
output_folder <- "."
con <- file(binfile_path, "r")
binfile <- readLines(con, skipNul = TRUE)
close(con)
measurements <- sample_binfile(binfile, binfile_path, output_folder)

GENEAcore documentation built on April 11, 2025, 5:43 p.m.