STEP 1) Read data from all PULSE files in the target folder-->> step 1 -- pulse_read() <<--
step 2 -- pulse_split()
step 3 -- pulse_optimize()
step 4 -- pulse_heart()
step 5 -- pulse_doublecheck()
step 6 -- pulse_choose_keep()
Importing data from PULSE '.csv' files is the first step of the analysis of PULSE data.
pulse_read() checks that the paths provided by the user conform to certain expectations and then reads the data from all files and merges into a single tibble. Only data from the same experiment should be read at the same time (i.e., with the same channel names, collected with the same sampling frequency, and produced using a PULSE multi-channel or a PULSE one-channel system running the same firmware version throughout the experiment). To put it differently, one call to pulse_read() can only read files where the header is absolutely invariant, and only the data portion of the files differs. The output of pulse_read() can be directly passed on to pulse_split().
pulse_read(paths, msg = TRUE)A list with four elements:
$data , tibble containing all data from all PULSE files
$multi, logical indicating if the data is from a multi-channel system (TRUE) or from a one-channel system (FALSE)
$vrsn , numeric value representing the version number of the PULSE system where the data was generated
$freq , numeric value representing the sampling frequency used (in Hz)
character vectors, containing file paths to CSV files produced by a PULSE system during a single experiment.
logical, defaults to TRUE; should non-crucial messages (but not errors) be shown (mostly for use from within the wrapper function PULSE(), where it is set to FALSE to avoid the repetition of identical messages)
PULSE systems ALWAYS record data using UTC +0. This is intentional! If data were to be recorded using local time zones, issues with daylight saving time, leap seconds, etc. could spoil the dataset. Worse, should the information about which time zone had been used get lost or accidentally modified, the validity of the entire dataset could be compromised. By always using UTC +0 all these issues are minimized and the processing pipeline becomes vastly easier and more efficient. Still, this means that after the data has been processed using the heartbeatr-package, the user may need to adjust the time zone of all timestamps so that the timing matches other information relative to the experiment.
pulse_split(), pulse_optimize(), pulse_heart(), pulse_doublecheck() and pulse_choose_keep() are the other functions needed for the complete PULSE processing workflow
PULSE() is a wrapper function that executes all the steps needed to process PULSE data at once
## Begin prepare data ----
paths <- pulse_example()
## End prepare data ----
pulse_read(paths)
Run the code above in your browser using DataLab