Title: | Lagrangian Sampling Interpretation |
---|---|
Description: | Conservative tracers within the water can be used to interpret the results of a sampling compaign following one water parcel (Lagrangian Sampling). |
Authors: | Malte Zamzow [aut, cre] , Kompetenzzentrum Wasser Berlin gGmbH (KWB) [cph] |
Maintainer: | Malte Zamzow <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.0.9000 |
Built: | 2024-11-20 10:37:37 UTC |
Source: | https://github.com/KWB-R/kwb.waterParcel |
Check for unique units per parameter
check_for_units(df_in)
check_for_units(df_in)
df_in |
Data frame loaded with |
Returns either a warning or a confirmation
Removes all samples without complete tracer data
discard_na_samples(MCS_input)
discard_na_samples(MCS_input)
MCS_input |
A list of tracer concentrations per sample |
A list of tracer concentrations per sample
Random concentrations in all samples based on measured data and assumed deviation
get_all_sample_concentrations( input_table, predictor_samples, tracer_names, MCS_runs, rel_deviation )
get_all_sample_concentrations( input_table, predictor_samples, tracer_names, MCS_runs, rel_deviation )
input_table |
Data frame reshaped by function |
predictor_samples |
A character vector of names of samples used for predicting the substance concentration of the remaining samples. |
tracer_names |
A vector of character strings defining the tracers used |
MCS_runs |
The number of random samples drawn (Monte-Carlo-Simulation runs) |
rel_deviation |
Either one numeric value between 0 and 1 defining the standard deviation relative to the measured value for all tracers or a vector of the same length as 'tracer_names' defining a deviation for each tracer |
A List of data frames with columns corresponding to the tracers and rows correspoding to the Monte Carlo runs. The predictor samples are the first three entries and are named "A", "B" and "C"
Find minimum and maximum of the tracers in all samples (including MCS)
get_concentration_ranges(MCS_input)
get_concentration_ranges(MCS_input)
MCS_input |
A list of sample Data frames created by
|
Random concentrations in sample based on measured data and assumed deviation
get_varrying_sample_concentration( input_table, sample_name, tracer_names, MCS_runs, rel_deviation )
get_varrying_sample_concentration( input_table, sample_name, tracer_names, MCS_runs, rel_deviation )
input_table |
Data frame reshaped by function |
sample_name |
A character string defining the sample |
tracer_names |
A vector of character strings defining the tracers used |
MCS_runs |
The number of random samples drawn (Monte-Carlo-Simulation runs) |
rel_deviation |
Either one numeric value between 0 and 1 defining the standard deviation relative to the measured value for all tracers or a vector of the same length as 'tracer_names' defining a deviation for each tracer |
A data frame, columns corresponding to the tracers and rows correspoding to the runs.
The CSV table must contain one row per measurement and standard column names as defined in the details section
load_lab_data(path, file)
load_lab_data(path, file)
path |
The filepath |
file |
The filename including the ".csv" ending |
Required table column names:
sample_name: unique ID of the sample (at least unique per sampling campaign)
sampling_campaign: unique ID of the sampling campaign
tBeg: starting time of the sample (format: "YYYY-mm-dd HH:MM:SS")
tEnd: ending time of the sample (format: "YYYY-mm-dd HH:MM:SS")
operator: definition of LOD-relation (either "<", ">" or empty)
value: measured value
parameter: unique name of the measured parameter (this parameter is used
column name after reshaping the table, so it should not start with a number
or contain any special symbols or spaces)
unit: the unit of the measured value
A data frame corresding to the csv file, with date columns specified as POSIXct
Transforms tracer concentrations into normalized values between 0 and 1
normalize_MCS_input(MCS_input)
normalize_MCS_input(MCS_input)
MCS_input |
A list of sample Data frames created by
|
Normalization per tracer by equation:
(c_i - min(c)) / (max(c) - min(c))
This results in values between 0 (equals the overall minimal value of the
tracer within all samples) and 1 (equals the overall maximal value of the
tracer within all samples).
Same structured list as the input with normalized values instead of absolute concentrations
This function keeps the columns "sample_name", "sampling_campaign", "tBeg", "tEnd" and adds one column per parameter. The operators are taken into account.
reshape_table(df_in, sampling_campaigns, bLOD = "na", aLOD = "na")
reshape_table(df_in, sampling_campaigns, bLOD = "na", aLOD = "na")
df_in |
Data frame loaded with |
sampling_campaigns |
One or more sampling Campaign IDs to be considered |
bLOD |
Character string defining the handling of operator "<" (below limit of detection). Either "half" for dividing the value by 2, "zero" or "na" for setting the value to 0 or NA, respectively. |
aLOD |
Character string defining the handling of operator ">" (above limit of detection). Either "double" for multiplying the value by 2, "use_limit" for using the limit value or "na" for setting the value to NA. |
A data frame of all data per sample in a row, arranged by the starting time of the sample.