Typical output from personal environmental monitors will be plain text files containing either raw data in a readily usable format (e.g. PATS+, UPAS) or raw data in binary format which needs to be pre-processed using the monitor software (e.g. ECM).
'read_monitor()' will read data from a single file and return a data frame with all the columns contained in the file.
Path to the file containing monitor data.
Type of monitor with which the data was recorded. Currently there are five valid types:
* "patsp": data from PATS+ monitors.
* "upas": data from UPAS monitors.
* "ecm": data from ECM.
* "ecm-full": same as "ecm". Use this type to extract more variables when
Any other option will be coerced to "unknown" and return an empty data frame.
Additional arguments passed to
Usually you will be interested in reading data form multiple files, this
can be easily achieved by listing in a data frame all files and types you
want to read and iterating over it with
purrr::map2 as shown
in the examples below.
A data frame with all columns from the monitor file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## Not run: # Load required packages library(package = "pemr") # Define files and types. This can be any data frame, so composing data in a # spreadsheet and reading it in works too data_frame( files_col = c("path/to/file1.csv", "path/to/file2.csv"), types_col = c("ecm", "upas") ) %>% mutate( data = map2(files_col, types_col, read_monitor) ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.