The goal of uid is to streamline the processing of temperature data exported from UID devices. It provides functions for cleaning, outlier detection, downsampling, and diagnostic plotting, assuming a structured directory layout for raw and processed data.
Installation
You can install the development version of uid like so:
devtools::install_github("matiasandina/uid")
Example
library(uid)
# Process all raw UID CSVs from a directory
process_all_uid_files(
raw_export_dir = "temperature/raw_data",
output_dir = "temperature/data"
)
This will:
- Group files by shared base name (e.g. handling _1_of_n format)
- Remove temperature outliers
- Downsample by 1-minute intervals (by default)
- Save cleaned data and diagnostic plots
You can also use lower-level functions for more custom workflows:
df <- read_raw_uid_csv("path/to/file.csv")
df_flagged <- flag_temperature_outliers(df, threshold = 1)
df_clean <- df_flagged |> dplyr::filter(!outlier_global)
df_downsampled <- downsample_temperature(df_clean)