bh_read_raw: Read a BlueHill RawData file

View source: R/old_code/bluehill_functions.2.R View source: R/bluehill_functions.R

bh_read_rawR Documentation

Read a BlueHill RawData file

Description

RawData files can contain optional header rows that describe the test as parameter: value pairs, followed by a blank row, then the recorded data.

Usage

bh_read_raw(filename, min_results = TRUE, use_label = TRUE,
  use_filename = FALSE, headers = FALSE)

Arguments

filename

the name of the RawData file to process.

min_results

if TRUE only return three columns: (Time, Load, Position). Defaults to TRUE.

use_label

if TRUE add any label field in the header as a column in the output. Defaults to TRUE.

use_filename

if TRUE use the filename as the specimen_ID otherwise add a unique numeric specimen_ID for each file. Defaults to FALSE.

headers

if TRUE return a data.table containing any parameter:value pairs and blank_row indicating the end of the header. blank_row = 0 if there were no headers. Defaults to FALSE.

Details

The data part has two rows of column header: variable names in the first row, then units in the second. Subsequent rows have the data in columns.

This function reads any parameters into a data.table with columns for "type", "var", "value" and "units" A special header is added to describe the location of the end of the header as information, blank_row, n wheren is the row number of the blank line that marks the end of the header (0 is there was no header). This can be passed to bh_read_data to indicate where the data starts.

Value

if headers == TRUE a list with data = a data.table holding the raw data and header = a data.table holding headers if headers == FALSE just the data.table holding the raw data


yadbor/bluer documentation built on Jan. 31, 2023, 7:44 p.m.