mc_join {myClim}R Documentation

Joining time-series from repeated downloads

Description

The function is designed to merge time-series data obtained through repeated downloads in the same location. Within a specific locality, the function performs the merging based on logger type, physical element, and sensor height

Usage

mc_join(data, comp_sensors = NULL)

Arguments

data

myClim object in Raw-format. see myClim-package

comp_sensors

senors for compare and select source logger; If NULL then first is used. (default NULL)

Details

Joining is restricted to the myClim Raw-format (refer to myClim-package). Loggers need to be organized within localities. The simplest method is to use mc_read_data, providing both files_table and localities_table. When using mc_read_files without metadata, a bit more coding is needed. In this case, you can create multiple myClim objects and specify correct locality names afterwards, then merge these objects using mc_prep_merge, which groups loggers based on identical locality names.

The joining function operates seamlessly without user intervention in two scenarios:

  1. when the start of a newer time series aligns with the end of an older one, and

  2. when the two time-series share identical values during the overlap.

However, if values differ during the overlap, the user is prompted to interactively choose which time-series to retain and which to discard. myClim provides information about differing time-series in the console, including locality ID, problematic interval (start-end), older logger ID and its time series start-end, and newer logger ID and its time series start-end. Additionally, an interactive graphical window (plotly) displays conflicting time series, allowing the user to zoom in and explore values. In case of multiple conflicts, myClim sequentially asks the user for decisions.

Users have seven options for handling overlap conflicts, six of which are pre-defined. The seventh option allows the user to specify the exact time to trim the older time-series and use the newer one. The options include:

Users must press the number key, hit Return/Enter, or write in console the exact date in the format ⁠YYYY-MM-DD hh:mm⁠ to trim the older series and continue with the newer series.

Loggers with multiple sensors are joined based on one or more selected sensors (see parameter comp_sensors). The name of the resulting joined sensor is taken from the logger with the oldest data. If serial_number is not equal during logger joining, the resulting serial_number is NA. Clean info is changed to NA except for the step. When joining a non-calibrated sensor with a calibrated one, the calibration information must be empty in the non-calibrated sensor.

For example of joining see myClim vignette.

WARNING

mc_join expects a maximum of one logger of a certain type and height measuring certain elements in one locality. In other words, if you use multiple logger of identical type at identical heights in one locality, you cannot use mc_join directly; you have to split your locality into sub-localities.

Value

myClim object with joined loggers.


[Package myClim version 1.1.0 Index]