Nothing
test_that("test-write_model_result_csv - walsby_modified - 20240925.csv", {
test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv")
data <- read_dual_pam_data(test_data_file)
model_result <- walsby_generate_regression_ETR_II(data)
model_result <- walsby_modified(model_result)
result_dir <- testthat::test_path("results")
dir.create(result_dir, showWarnings = FALSE)
model_result_csv_path <- file.path(result_dir, "20240925_modified_model_result.csv")
raw_data_csv_path <- file.path(result_dir, "20240925_modified_raw_data.csv")
regression_data_csv_path <- file.path(result_dir, "20240925_modified_regression_data.csv")
unlink(model_result_csv_path)
unlink(raw_data_csv_path)
unlink(regression_data_csv_path)
write_model_result_csv(
result_dir,
"20240925_modified",
data,
model_result
)
model_result_csv <- read.csv(
file = model_result_csv_path,
colClasses = c(
residual_sum_of_squares = "numeric",
root_mean_squared_error = "numeric",
relative_root_mean_squared_error = "numeric",
saturation = "logical",
a = "numeric",
b = "numeric",
c = "numeric",
d = "numeric",
alpha = "numeric",
beta = "numeric",
etrmax_with_photoinhibition = "numeric",
etrmax_without_photoinhibition = "numeric",
ik_with_photoinhibition = "numeric",
ik_without_photoinhibition = "numeric",
im_with_photoinhibition = "numeric",
w = "numeric",
ib = "numeric",
etrmax_without_with_ratio = "numeric"
)
)
expect_equal(model_result_csv$a, model_result$a)
expect_equal(model_result_csv$b, model_result$b)
expect_equal(model_result_csv$c, model_result$c)
expect_equal(model_result_csv$d, model_result$d)
expect_equal(model_result_csv$alpha, model_result$alpha)
expect_equal(model_result_csv$beta, model_result$beta)
expect_equal(model_result_csv$etrmax_with_photoinhibition, model_result$etrmax_with_photoinhibition)
expect_equal(model_result_csv$etrmax_without_photoinhibition, model_result$etrmax_without_photoinhibition)
expect_equal(model_result_csv$im_with_photoinhibition, model_result$im_with_photoinhibition)
expect_equal(model_result_csv$w, model_result$w)
expect_equal(model_result_csv$ib, model_result$ib)
expect_equal(model_result_csv$etrmax_without_with_ratio, model_result$etrmax_without_with_ratio)
expect_equal(model_result_csv$saturation, model_result$saturation)
raw_data_csv <- read.csv(
file = raw_data_csv_path,
colClasses = "numeric"
)
expect_equal(as.data.frame(raw_data_csv), as.data.frame(data))
regression_data_csv <- read.csv(
file = regression_data_csv_path,
colClasses = "numeric"
)
expect_equal(as.data.frame(regression_data_csv), as.data.frame(model_result$etr_regression_data))
})
test_that("test-write_model_result_csv - walsby - 20240925.csv", {
test_data_file <- testthat::test_path("data", "dual_pam_data", "20240925.csv")
data <- read_dual_pam_data(test_data_file)
model_result <- walsby_generate_regression_ETR_II(data)
result_dir <- testthat::test_path("results")
dir.create(result_dir, showWarnings = FALSE)
model_result_csv_path <- file.path(result_dir, "20240925_model_result.csv")
raw_data_csv_path <- file.path(result_dir, "20240925_raw_data.csv")
regression_data_csv_path <- file.path(result_dir, "20240925_regression_data.csv")
unlink(model_result_csv_path)
unlink(raw_data_csv_path)
unlink(regression_data_csv_path)
write_model_result_csv(
result_dir,
"20240925",
data,
model_result
)
model_result_csv <- read.csv(
file = model_result_csv_path,
colClasses = c(
residual_sum_of_squares = "numeric",
root_mean_squared_error = "numeric",
relative_root_mean_squared_error = "numeric",
etr_max = "numeric",
alpha = "numeric",
beta = "numeric"
)
)
expect_equal(model_result_csv$a, model_result$a)
expect_equal(model_result_csv$b, model_result$b)
expect_equal(model_result_csv$c, model_result$c)
expect_equal(model_result_csv$d, model_result$d)
expect_equal(model_result_csv$alpha, model_result$alpha)
expect_equal(model_result_csv$beta, model_result$beta)
expect_equal(model_result_csv$etrmax_with_photoinhibition, model_result$etrmax_with_photoinhibition)
expect_equal(model_result_csv$etrmax_without_photoinhibition, model_result$etrmax_without_photoinhibition)
expect_equal(model_result_csv$im_with_photoinhibition, model_result$im_with_photoinhibition)
expect_equal(model_result_csv$w, model_result$w)
expect_equal(model_result_csv$ib, model_result$ib)
expect_equal(model_result_csv$etrmax_without_with_ratio, model_result$etrmax_without_with_ratio)
raw_data_csv <- read.csv(
file = raw_data_csv_path,
colClasses = "numeric"
)
expect_equal(as.data.frame(raw_data_csv), as.data.frame(data))
regression_data_csv <- read.csv(
file = regression_data_csv_path,
colClasses = "numeric"
)
expect_equal(as.data.frame(regression_data_csv), as.data.frame(model_result$etr_regression_data))
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.