ufp_batch_read: Read multiple PUFP .txt files

View source: R/batch_read.R

ufp_batch_readR Documentation

Read multiple PUFP .txt files

Description

ufp_batch_read() imports and cleans multiple PUFP text files as a single data frame. Measurements from different monitoring sessions are denoted by the 'Sampling_Event' column, which is defined by event_threshold.

Usage

ufp_batch_read(
  paths,
  event_threshold = 10,
  tz = "America/New_York",
  truncate_ufp = TRUE,
  coords = TRUE,
  ufp_check = FALSE,
  participant_id = NULL,
  sample_col = NULL,
  sample_id = NULL,
  time_correction = NULL
)

Arguments

paths

a vector of paths

event_threshold

numeric; difftime value in minutes to differentiate sampling events. Consecutive measurements that exceed this threshold are separated into new sampling events. Default = 10.

tz

a character string that specifies which time zone to parse the date with. Default = 'America/New_York.'

truncate_ufp

logical; truncate UFP concentration? If TRUE (the default), UFP concentrations above 250K will be right censored.

coords

logical; arse GPS string to derive latitude and longitude? Default = TRUE.

ufp_check

check for invalid UFP measurements. If TRUE, new columns named UFP_NA and UFP_Invalid are created to flag missing and potentially invalid UFP concentrations.

participant_id

user defined string to denote a personal identifier. This is useful if the PUFP is deployed during personal sampling. If specified, a new column is created ('ID'). Default is NULL.

sample_col

user defined character string specifying the name of the column to denote sample ID. Default is NULL.

sample_id

user defined string to denote sample ID. If assigned, a value must also be supplied to sample_col. Default is NULL.

time_correction

numeric; second threshold to correct Date_Time using GPS recorded time.

Value

a tibble. Additional columns are created for 'Sampling_Event' and 'Sampling_Day.' Sampling events represent discreet intervals in sampling defined by the event_threshold. Sampling day is derived from the date of the measurements. Multiple sampling events may occur within a sampling day.

Examples

## Not run: 

ufp_batch_read(c(path1, path2, path3),
  event_threshold = 10,
  tz = "America/New_York", truncate_ufp = TRUE, coords = TRUE, ufp_check = FALSE,
  participant_id = NULL, sample_col = NULL, sample_id = NULL
)

## End(Not run)

wolfeclw/pufpR documentation built on April 2, 2022, 9:48 a.m.