join_datasets {LightLogR} | R Documentation |
Join similar Datasets
Description
Join Light logging datasets that have a common structure. The least commonality are identical columns for Datetime
and Id
across all sets.
Usage
join_datasets(
...,
Datetime.column = Datetime,
Id.column = Id,
add.origin = FALSE,
debug = FALSE
)
Arguments
... |
|
Datetime.column , Id.column |
Column names for the |
add.origin |
Should a column named |
debug |
Output changes to a tibble indicating which dataset is missing the respective |
Value
One of
a
data.frame
of joined datasetsa
tibble
of datasets with missing columns. Only ifdebug = TRUE
Examples
#load in two datasets
path <- system.file("extdata",
package = "LightLogR")
file.LL <- "205_actlumus_Log_1020_20230904101707532.txt.zip"
file.env <- "cyepiamb_CW35_Log_1431_20230904081953614.txt.zip"
dataset.LL <- import$ActLumus(file.LL, path, auto.id = "^(\\d{3})")
dataset.env <- import$ActLumus(file.env, path, manual.id = "CW35")
#join the datasets
joined <- join_datasets(dataset.LL, dataset.env)
#compare the number of rows
nrow(dataset.LL) + nrow(dataset.env) == nrow(joined)
#debug, when set to TRUE, will output a tibble of datasets with missing necessary columns
dataset.LL <- dataset.LL %>% dplyr::select(-Datetime)
join_datasets(dataset.LL, dataset.env, debug = TRUE)
[Package LightLogR version 0.3.8 Index]