The library ‘pam’ was developed to process PAM raw data (chlorophyll fluorometry to analyze photosystem II and dual wavelength absorbance spectrometry to analyze photosystem I), for example from the DUAL PAM of the manufacturer WALZ.
Four different models are provided for the regression of the light curve (Vollenweider (1965), Platt (1980), Eilers and Peeters (1988) and Walsby (1997)).
To select the most suitable model for the respective data set, the models can be compared with each other. To avoid confusion in the naming of the variables and calculated factors such as
install.packages("remotes")
remotes::install_github("biotoolbox/pam", subdir = "src")
Examples of usage can be found in the examples
directory.
This function reads the original CSV file as created by the DualPAM software, processes it by calculating
- csv_path: A string representing the file path to the CSV file.
- remove_recovery: Automatic removal of recovery measurements after the actual Pi curve for an accurate regression. Default is
TRUE
. - etr_factor: A numeric value used as a factor for calculating ETR. Default is
0.84
. - p_ratio: A numeric value representing the ratio of PS II / PSI used in the ETR calculation formula. Default is
0.5
. Calculated as:
ETR values are calculated using the following formula:
The function processes the provided CSV file by:
- Reading the CSV data using
read.csv()
. - Filtering rows where the column
ID
equalsSP
. - Combining the
Date
andTime
columns to create a newDateTime
column. - Calculating the ETR values for both
Y.I.
andY.II.
using the functioncalc_etr()
. - Removing rows from the recovery period if
remove_recovery = TRUE
.
A data.table
containing the processed data with additional columns for recalculated ETR values.
data <- read_dual_pam_data("path/to/data.csv",
remove_recovery = TRUE,
etr_factor = 0.84,
p_ratio = 0.5)
- Heinz Walz GmbH. (2024). DUAL-PAM-100 DUAL-PAM/F MANUAL, 5th Edition, April 2024, Chapter 7 (pp. 162-172). Heinz Walz GmbH, Effeltrich, Germany. Available at: DUAL-PAM-100 Manual
This function generates a regression model based on Vollenweider (1965). Original naming conventions from the publication are used.
-
data: A
data.table
containing the input data fromread_dual_pam_data
. - etr_type: A character string specifying the column name of the response variable (ETR I or ETR II) to be used in the model.
-
pmax_start_value_vollenweider: Numeric. The starting value for the parameter
$$p_{max}$$ in the model. Defaults topmax_start_values_vollenweider_default
. -
a_start_value_vollenweider: Numeric. The starting value for the parameter
$$a$$ in the model. Defaults toa_start_values_vollenweider_default
. -
alpha_start_value: Numeric. The starting value for the parameter
$$\alpha$$ in the model. Defaults toalpha_start_values_vollenweider_default
. -
n_start_value: Numeric. The starting value for the parameter
$$n$$ in the model. Defaults ton_start_values_vollenweider_default
.
A list containing the following elements:
-
etr_regression_data: A
data.table
with the predicted values of ETR I or ETR II to each PAR based on the fitted model. - sdiff: The deviation between the actual and predicted ETR values.
-
pmax: The maximum electron transport rate without photoinhibition (
$$p_{max}$$ ). -
a: The obtained parameter
$$a$$ . -
alpha: The obtained parameter
$$\alpha$$ . -
n: The obtained parameter
$$n$$ . -
popt: The maximum electron transport rate with photoinhibition (
$$p_{opt}$$ ). A function computes predicted photosynthetic rates for each PAR value and tracks the maximum rate observed:
popt <- 0
pars <- c()
predictions <- c()
for (p in min(data$PAR):max(data$PAR)) {
pars <- c(pars, p)
prediction <- pmax * (((a * p) / (sqrt(1 + (a * p)^2))) * (1 / (sqrt(1 + (alpha * p)^2)^n)))
predictions <- c(
predictions,
prediction
)
if (prediction > popt) {
popt <- prediction
}
}
-
ik: PAR where the transition point from light limitation to light saturation is achieved without photoinhibition (
$$I_k$$ ). Calculated as:
-
iik: PAR where the transition point from light limitation to light saturation is achieved with photoinhibition (
$$I_k^\prime$$ ). Calculated as:
-
pmax_popt_and_ik_iik_ratio: Ratio of
$$p_{max}$$ to$$p_{opt}$$ and$$I_k$$ to$$I_k^\prime$$ ($$p_{max} / p_{opt}$$ ). Calculated as:
This function uses non-linear least squares fitting to estimate the parameters for the Vollenweider model, which describes the relationship between PAR and ETR. The model used is:
It is valid:
result_vollenweider_ETR_II <- vollenweider_generate_regression_ETR_II(data,
pmax_start_value_vollenweider = 40,
a_start_value_vollenweider = 0.1,
alpha_start_value = -0.0001,
n_start_value = 350)
Vollenweider, R. A. (1965). Calculation models of photosynthesis-depth curves and some implications regarding day rate estimates in primary production measurements, p. 427-457. In C. R. Goldman [ed.], Primary Productivity in Aquatic Environments. Mem. Ist. Ital. Idrobiol., 18 Suppl., University of California Press, Berkeley.
This function generates a regression model based on Platt (1980). Original naming conventions from the publication are used.
-
data: A
data.table
containing the input data fromread_dual_pam_data
. -
alpha_start_value_platt: Numeric. The starting value for the parameter
$$\alpha$$ in the model. Defaults toalpha_start_value_platt_default
. -
beta_start_value_platt: Numeric. The starting value for the parameter
$$\beta$$ in the model. Defaults tobeta_start_value_platt_default
. -
ps_start_value_platt: Numeric. The starting value for the parameter
$$p_s$$ in the model. Defaults tops_start_value_platt_default
.
A list containing the following elements:
-
etr_regression_data: A
data.table
with the predicted values of ETR I or ETR II to each PAR based on the fitted model. - sdiff: The deviation between the actual and predicted ETR values.
-
ps: The maximum electron transport rate without photoinhibition (
$$P_s$$ ). -
alpha: The initial slope of the light curve (
$$\alpha$$ ). -
beta: The photoinhibition of the light curve (
$$\beta$$ ). -
pm: The maximum electron transport rate with photoinhibition (
$$P_m$$ ). Calculated as:
-
ik: PAR where the transition point from light limitation to light saturation is achieved with photoinhibition (
$$I_k$$ ). Calculated as:
-
is: PAR where the transition point from light limitation to light saturation is achieved without photoinhibition (
$$I_s$$ ). Calculated as:
-
im: The PAR at which the maximum electron transport rate is achieved with photoinhibition (
$$I_m$$ ). Calculated as:
-
ib: (
$$I_b$$ ) Calculated as:
This function uses non-linear least squares fitting to estimate the parameters for the Platt model, which describes the relationship between PAR and ETR. The model used is:
It is valid:
result_platt_ETR_II <- platt_generate_regression_ETR_II(data,
alpha_start_value_platt = 0.3,
beta_start_value_platt = 0.01,
ps_start_value_platt = 30)
Platt, T., Gallegos, C. L., & Harrison, W. G. (1980). Photoinhibition of photosynthesis in natural assemblages of marine phytoplankton. Journal of Marine Research, 38(4). Retrieved from https://elischolar.library.yale.edu/journal_of_marine_research/1525.
This function generates a regression model based on Eilers-Peeters (1988). Original naming conventions from the publication are used. All parameters are calculated taking photoinhibition into account.
-
data: A
data.table
containing the input data fromread_dual_pam_data
. -
a_start_value: Numeric. The starting value for the parameter
$$a$$ in the model. Defaults toa_start_values_eilers_peeters_default
. -
b_start_value: Numeric. The starting value for the parameter
$$b$$ in the model. Defaults tob_start_values_eilers_peeters_default
. -
c_start_value: Numeric. The starting value for the parameter
$$c$$ in the model. Defaults toc_start_values_eilers_peeters_default
.
A list containing the following elements:
-
etr_regression_data: A
data.table
with the predicted values of ETR I or ETR II to each PAR based on the fitted model. - sdiff: The deviation between the actual and predicted ETR values.
-
a: The obtained parameter
$$a$$ . -
b: The obtained parameter
$$b$$ . -
c: The obtained parameter
$$c$$ . -
pm: The maximum electron transport rate (
$$p_m$$ ). Calculated as:
-
s: The initial slope of the light curve (
$$s$$ ). Calculated as:
-
ik: PAR where the transition point from light limitation to light saturation is achieved (
$$I_k$$ ). Calculated as:
-
im: The PAR at which the maximum electron transport rate is achieved (
$$I_m$$ ). Calculated as:
-
w: The sharpness of the peak (
$$w$$ ). Calculated as:
This function uses non-linear least squares fitting to estimate the parameters for the Eilers-Peeters model, which describes the relationship between PAR and ETR. The model used is:
It is valid:
result_eilers_peeters_ETR_II <- eilers_peeters_generate_regression_ETR_II(data,
a_start_value = 0.00004,
b_start_value = 0.004,
c_start_value = 5)
Eilers, P. H. C., & Peeters, J. C. H. (1988). A model for the relationship between light intensity and the rate of photosynthesis in phytoplankton. Ecological Modelling, 42(3-4), 199-215. doi:10.1016/0304-3800(88)90057-9.
This function generates a regression model based on Walsby (1997) in a modified version without the respiration term. Naming conventions from Romoth (2019) are used. ETRmax is calculated without taking photoinhibition into account.
-
data: A
data.table
containing the input data fromread_dual_pam_data
. -
etr_max_start_value_walsby: Numeric. The starting value for the parameter
$$ETR_{max}$$ in the model. Defaults toetr_max_start_value_walsby_default
. -
alpha_start_value_walsby: Numeric. The starting value for the parameter
$$\alpha$$ in the model. Defaults toalpha_start_value_walsby_default
. -
beta_start_value_walsby: Numeric. The starting value for the parameter
$$\beta$$ in the model. Defaults tobeta_start_value_walsby_default
.
A list containing the following elements:
-
etr_regression_data: A
data.table
with the predicted values of ETR I or ETR II to each PAR based on the fitted model. - sdiff: The deviation between the actual and predicted ETR values.
-
etr_max: The maximum electron transport rate without photoinhibition (
$$ETR_{max}$$ ). -
alpha: The initial slope of the light curve (
$$\alpha$$ ). -
beta: The photoinhibition of the light curve (
$$\beta$$ ).
This function uses non-linear least squares fitting to estimate the parameters for the Walsby model, which describes the relationship between PAR and ETR I. The model used is:
It is valid:
Walsby, A. E. (1997). Numerical integration of phytoplankton photosynthesis through time and depth in a water column. New Phytologist, 136(2), 189-209. https://doi.org/10.1046/j.1469-8137.1997.00736.x
Romoth, K., Nowak, P., Kempke, D., Dietrich, A., Porsche, C., & Schubert, H. (2019). Acclimation limits of Fucus evanescens along the salinity gradient of the southwestern Baltic Sea. Botanica Marina, 62(1), 1-12. https://doi.org/10.1515/bot-2018-0098
This function adds parameters that were not originally included in the Vollenweider (1965) model, but were introduced by other models and renames the parameters to a standardised one for all models. See the table below.
- model_result: A list containing the results of the model, including parameters such as
pmax
,alpha
, andik
.
Returns a modified model result as a list with the following elements:
- etr_type: ETR Type based on the model result.
- etr_regression_data: Regression data with ETR predictions based on the fitted model.
- sdiff: The difference between observed and predicted ETR values.
- a: obtained paramter
a
, here equal toetrmax_without_photoinhibition
- b: obtained paramter
b
, transfered asa
- c: obtained paramter
c
, here transfered asalpha
- d: obtained paramter
c
, here transfered asn
- alpha: The initial slope of the light curve, calculated as:
- beta: Not available, here set to
NA_real_
- etrmax_with_photoinhibition: The maximum electron transport rate with photoinhibition, transfered as
popt
- etrmax_without_photoinhibition: The maximum electron transport rate without photoinhibition, transfered as:
pmax
- ik_with_photoinhibition: PAR where the transition point from light limitation to light saturation is achieved taking photoinhibition into account, transfered as:
iik
- ik_without_photoinhibition: PAR where the transition point from light limitation to light saturation is achieved not taking photoinhibition into account, transfered as:
ik
- im_with_photoinhibition: The PAR at which the maximum electron transport rate is achieved by taking photoinhibition into account, determined as:
etr_regression_data <- get_etr_regression_data_from_model_result(model_result)
im_with_photoinhibition <- etr_regression_data[etr_regression_data[[prediction_name]] == max(etr_regression_data[[prediction_name]]), ][[PAR_name]]
- w: Not available, here set to
NA_real_
- ib: Not available, here set to
NA_real_
- etrmax_with_without_ratio: Ratio of
etrmax_with_photoinhibition
toetrmax_without_photoinhibition
andik_with_photoinhibition
toik_without_photoinhibition
, transfered as:pmax_popt_and_ik_iik_ratio
This function validates the model_result
input and processes relevant parameters for the Vollenweider model, creating a structured list using create_modified_model_result
. This standardized output allows for consistent analysis and comparison across different models.
modified_result_vollenweider <- vollenweider_modified(model_result_vollenweider)
This function adds parameters that were not originally included in the Platt (1980) model, but were introduced by other models and renames the parameters to a standardised one for all models. See the table below.
- model_result: A list containing the results of the model, including parameters such as
etr_max
,alpha
, andbeta
.
Returns a modified model result as a list with the following elements:
- etr_type: ETR Type based on the model result.
- etr_regression_data: Regression data with ETR predictions based on the fitted model.
- sdiff: The difference between observed and predicted ETR values.
- a: obtained paramter
a
, here equal toetrmax_without_photoinhibition
- b: obtained paramter
b
, here equal toalpha
- c: obtained paramter
c
, here equal tobeta
- d: not available, here set to
NA_real_
- alpha: The initial slope of the light curve, transfered unchanged as
alpha
- beta: The photoinhibition of the light curve, transfered unchanged as
beta
- etrmax_with_photoinhibition: The maximum electron transport rate with photoinhibition, transfered as
pm
- etrmax_without_photoinhibition: The maximum electron transport rate without photoinhibition, transfered as:
ps
- ik_with_photoinhibition: PAR where the transition point from light limitation to light saturation is achieved taking photoinhibition into account, transfered as:
ik
- ik_without_photoinhibition: PAR where the transition point from light limitation to light saturation is achieved not taking photoinhibition into account, transfered as:
is
- im_with_photoinhibition: The PAR at which the maximum electron transport rate is achieved by taking photoinhibition into account, transfered as:
im
- w: Not available, here set to
NA_real_
- ib: Transfered unchange as:
ib
- etrmax_with_without_ratio: Ratio of
etrmax_with_photoinhibition
toetrmax_without_photoinhibition
andik_with_photoinhibition
toik_without_photoinhibition
. Calculated as:
This function validates the model_result
input and processes relevant parameters for the Platt model, creating a structured list using create_modified_model_result
. This standardized output allows for consistent analysis and comparison across different models.
modified_result_platt <- platt_modified(model_result_platt)
This function adds parameters that were not originally included in the Eilers and Peeters (1988) model, but were introduced by other models and renames the parameters to a standardised one for all models. See the table below.
- model_result: A list containing the results of the model, including parameters such as
a
,b
,c
,s
,pm
,ik
,im
, andw
.
Returns a modified model result as a list with the following elements:
- etr_type: ETR Type based on the model result.
- etr_regression_data: Regression data with ETR predictions based on the fitted model.
- sdiff: The difference between observed and predicted ETR values.
-
a: The obtained parameter
$$a$$ -
b: The obtained parameter
$$b$$ -
c: The obtained parameter
$$c$$ -
d: Not available, here set to
NA_real_
-
alpha: The initial slope of the light curve, transfered unchanged as
s
-
beta: Not available, here set to
NA_real_
-
etrmax_with_photoinhibition: The maximum electron transport rate with photoinhibition, transfered as
pm
-
etrmax_without_photoinhibition: Not available, here set to
NA_real_
-
ik_with_photoinhibition: PAR where the transition point from light limitation to light saturation is achieved taking photoinhibition into account, transfered as
ik
-
ik_without_photoinhibition: Not available, here set to
NA_real_
-
im_with_photoinhibition: The PAR at which the maximum electron transport rate is achieved by taking photoinhibition into account, transfered as
im
-
w: The sharpness of the peak, transfered as
w
-
ib: Not available, here set to
NA_real_
-
etrmax_with_without_ratio: Not available, here set to
NA_real_
This function validates the model_result
input, extracts relevant parameters for the modified Eilers-Peeters model, and creates a structured list using create_modified_model_result
. The list serves as a standardized output format for further analysis.
# Example usage for eilers_peeters_modified
modified_result <- eilers_peeters_modified(model_result_eilers_peeters)
This function adds parameters that were not originally included in the Walsby (1997) model, but were introduced by other models and renames the parameters to a standardised one for all models. See the table below.
- model_result: A list containing the results of the model, including parameters such as
etr_max
,alpha
, andbeta
.
Returns a modified model result as a list with the following elements:
- etr_type: ETR Type based on the model result.
- etr_regression_data: Regression data with ETR predictions based on the fitted model.
- sdiff: The difference between observed and predicted ETR values.
- a: obtained paramter
a
, here equal toetrmax_without_photoinhibition
- b: obtained paramter
b
, here equal toalpha
- c: obtained paramter
c
, here equal tobeta
- d: not available, here set to
NA_real_
- alpha: The initial slope of the light curve, transfered unchanged as
alpha
- beta: The photoinhibition of the light curve, transfered unchanged as
beta
- etrmax_with_photoinhibition: The maximum electron transport rate with photoinhibition, determined as:
etr_regression_data <- get_etr_regression_data_from_model_result(model_result)
etr_max_row <- etr_regression_data[etr_regression_data[[prediction_name]] == max(etr_regression_data[[prediction_name]]), ]
etrmax_with_photoinhibition <- etr_max_row[[prediction_name]]
- etrmax_without_photoinhibition: The maximum electron transport rate without photoinhibition, transfered as:
etr_max
- ik_with_photoinhibition: PAR where the transition point from light limitation to light saturation is achieved taking photoinhibition into account, calculated as:
- ik_without_photoinhibition: PAR where the transition point from light limitation to light saturation is achieved not taking photoinhibition into account, calculated as:
- im_with_photoinhibition: The PAR at which the maximum electron transport rate is achieved by taking photoinhibition into account, calculated as:
etr_regression_data <- get_etr_regression_data_from_model_result(model_result)
etr_max_row <- etr_regression_data[etr_regression_data[[prediction_name]] == max(etr_regression_data[[prediction_name]]), ]
im_with_photoinhibition <- etr_max_row[[PAR_name]]
- w: Not available, here set to
NA_real_
- ib: Not available, here set to
NA_real_
- etrmax_with_without_ratio: Ratio of
etrmax_with_photoinhibition
toetrmax_without_photoinhibition
andik_with_photoinhibition
toik_without_photoinhibition
. Calculated as:
This function validates the model_result
input and processes relevant parameters for the Walsby model, creating a structured list using create_modified_model_result
. This standardized output allows for consistent analysis and comparison across different photosynthesis models.
modified_result <- walsby_modified(model_result_walsby)
modified | Eilers and Peeters | Platt | Walsby | Vollenweider |
---|---|---|---|---|
a | a | ps | etr_max | pmax |
b | b | alpha | alpha | a |
c | c | beta | beta | alpha |
d | NA | NA | NA | n |
alpha | s | alpha | alpha | NA |
beta | NA | beta | beta | NA |
etrmax_with_photoinhibition | pm | pm | NA | popt |
etrmax_without_photoinhibition | NA | ps | etr_max | pmax |
ik_with_photoinhibition | ik | ik | NA | iik |
ik_without_photoinhibition | NA | is | NA | ik |
im_with_photoinhibition | im | im | NA | NA |
w | w | NA | NA | NA |
ib | NA | ib | NA | NA |
etrmax_with_without_ratio | NA | NA | NA | pmax_popt_and_ik_iik_ratio |
sdiff | sdiff | sdiff | sdiff | sdiff |
Publication-accurate naming and the respective modified naming with additional calculations not included in the original publication
modified | Eilers and Peeters | Platt | Walsby | Vollenweider |
---|---|---|---|---|
sdiff | sdiff | sdiff | sdiff | sdiff |
a | a | ps | etr_max | pmax |
b | b | alpha | alpha | a |
c | c | beta | beta | alpha |
d | NA | NA | NA | n |
alpha | s | alpha | alpha | real_alpha |
beta | NA | beta | beta | NA |
etrmax_with_photoinhibition | pm | pm | etrmax_with_photoinhibition | popt |
etrmax_without_photoinhibition | NA | ps | etr_max | pmax |
ik_with_photoinhibition | ik | ik | ik_with_photoinhibition | iik |
ik_without_photoinhibition | NA | is | ik_without_photoinhibition | ik |
im_with_photoinhibition | im | im | im_with_photoinhibition | im_with_photoinhibition |
w | w | NA | NA | NA |
ib | NA | ib | NA | NA |
etrmax_with_without_ratio | NA | etrmax_with_without_ratio | etrmax_with_without_ratio | pmax_popt_and_ik_iik_ratio |
This function compares different regression models.
- data_dir: A character string specifying the directory where the input data files are located.
A vector containing the total points assigned to each regression model based on their performance. Models are ranked based on the calculated deviation of the difference between observed and predicted values. Rating:
- 1st: 3 points
- 2nd: 2 points
- 3rd: 1 point
- 4th: 0 points
This function allows a straightforward comparison of the models: Eilers-Peeters (1988), Platt (1980), Vollenweider (1965), and Walsby (1997). The results can guide users in selecting the most appropriate model for their data. If regression is not possible for a model, no points are awarded for the file for any of the models. Start values cannot be adjusted in this function.
#raw data file directory
data_dir_compare <- file.path(getwd(), "data")
#compare regression models
compare_regression_models_ETR_II <- compare_regression_models_ETR_II(data_dir_compare)
print(compare_regression_models_ETR_II)
Eilers, P. H. C., & Peeters, J. C. H. (1988). A model for the relationship between light intensity and the rate of photosynthesis in phytoplankton. Ecological Modelling, 42(3-4), 199-215. doi:10.1016/0304-3800(88)90057-9.
Platt, T., Gallegos, C. L., & Harrison, W. G. (1980). Photoinhibition of photosynthesis in natural assemblages of marine phytoplankton. Journal of Marine Research, 38(4). Retrieved from https://elischolar.library.yale.edu/journal_of_marine_research/1525.
Romoth, K., Nowak, P., Kempke, D., Dietrich, A., Porsche, C., & Schubert, H. (2019). Acclimation limits of Fucus evanescens along the salinity gradient of the southwestern Baltic Sea. Botanica Marina, 62(1), 1-12. https://doi.org/10.1515/bot-2018-0098
Vollenweider, R. A. (1965). Calculation models of photosynthesis-depth curves and some implications regarding day rate estimates in primary production measurements, p. 427-457. In C. R. Goldman [ed.], Primary Productivity in Aquatic Environments. Mem. Ist. Ital. Idrobiol., 18 Suppl., University of California Press, Berkeley.
Walsby, A. E. (1997). Numerical integration of phytoplankton photosynthesis through time and depth in a water column. New Phytologist, 136(2), 189-209. https://doi.org/10.1046/j.1469-8137.1997.00736.x
This function creates a control plot for the used model based on the provided data and model results.
- data: A
data.table
containing the original ETR and yield data for the plot. - model_result: A list containing the fitting results of the used model and the calculated parameters (alpha, ik, etc.).
- title: A character string that specifies the title of the plot.
- color: A color specification for the regression line in the plot.
A plot displaying the original ETR and Yield values and the regression data. A table below the plot shows the calculated data (alpha, ik, etc.).
plot_control_eilers_peeters_ETR_II <- plot_control(
data = pam_data,
model_result = modified_model_result_eilers_peeters_ETR_II,
title = "eilers_peeters ETR II modified 20231122_01.csv",
color = "purple"
)
print(plot_control_eilers_peeters_ETR_II)
The combo_control_plot
function generates a combined plot of electron transport rate (ETR) data and regression model predictions, along with a customized table summarizing the parameters for each model.
- title: A character string specifying the title for the plot.
- data: A data frame containing the raw input data for ETR and Photosynthetically Active Radiation (PAR).
- model_results: A list of model results, where each model result is a list containing regression data and parameters for ETR.
- name_list: A list of names corresponding to each model result. These names will be used in the legend and table.
- color_list: A list of color values for each model result. Colors are used to differentiate lines on the plot.
A plot displaying the original ETR and Yield values and the regression data from different models. A table below the plot shows the calculated data (alpha, ik, etc.).
test_data_file <- file.path(getwd(), "data", "20231122_01.csv")
data <- read_dual_pam_data(test_data_file)
eilers_peeters <- eilers_peeters_modified(eilers_peeters_generate_regression_ETR_II(data))
platt <- platt_modified(platt_generate_regression_ETR_II(data))
walsby <- walsby_modified(walsby_generate_regression_ETR_II(data))
vollenweider <- vollenweider_modified(vollenweider_generate_regression_ETR_II(data))
plot <- combo_control_plot(
"etr II test-combo_plot_control_20231122_01.csv",
data,
list(eilers_peeters, platt, walsby, vollenweider),
list("eilers_peeters", "platt", "walsby", "vollenweider"),
list("purple", "blue", "green", "red")
)
This function exports the raw input data, regression data, and model parameters into separate CSV files for easy access and further analysis.
- dest_dir: A character string specifying the directory where the CSV files will be saved.
- name: A character string specifying the base name for the output files.
- data: A data frame containing the raw input data used in the model.
- model_result: A list containing the model results, including parameter values and regression data.
This function creates three CSV files:
name_raw_data.csv
: Contains the original raw data used in the model.name_regression_data.csv
: Contains the regression data with predictions for electron transport rate (ETR).name_model_result.csv
: Contains the parameter values from the model results (excluding regression data), including parameters likealpha
,beta
, andetr_max
.
Each file will be named using the name
parameter as a prefix, followed by a specific suffix for clarity.
write_model_result_csv(
dest_dir = "output",
name = "eilers_peeters_experiment_001",
data = raw_data,
model_result = model_result_eilers_peeters
)
Skipped file: 20231214_14_W6_T5_ML.csv because of error: Error in eilers_peeters[["sdiff"]]: subscript out of bounds
This could indicate that Pm lable in the Action column is at the wrong position in the csv raw data file. Error could be caused by WALZ-Software.
Warnings:
1: Removed 1 row containing missing values or values outside the scale range (`geom_point()`).
2: Removed 1 row containing missing values or values outside the scale range (`geom_point()`).
3: Removed 1 row containing missing values or values outside the scale range (`geom_line()`).
All points and lines present. Reason for warning messages unknown. Possibly a problem in the library ggplot2.
library(devtools);
devtools::test();
library(devtools);
devtools::load_all();
library(testthat);
test_file('$$path')"
Ubuntu: libxml2-dev libssl-dev libcurl4-openssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
Debian: libxml2-dev libssl-dev libcurl4-openssl-dev libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libjpeg-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev
install.packages("data.table") install.packages("dplyr") install.packages("ggplot2") install.packages("minpack.lm") install.packages("SciViews") install.packages("ggthemes") install.packages("gridExtra")