File size: 1,413 Bytes
c223bdd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
library(testthat)
library(photosynthesis)
context("Estimating light respiration")
df = data.frame(
.A = c(
seq(from = -3, to = -1.5, by = 0.5),
seq(from = -1.25, to = 1, by = 0.25)
),
.Q = c(seq(from = 0, to = 130, by = 10))
)
fit = fit_photosynthesis(
.data = df,
.photo_fun = "r_light",
.model = "kok_1956",
Q_lower = 0,
Q_upper = 130
)
test_that("kok_1956 output", {
expect_is(object = fit, class = "lm")
})
df = data.frame(
.A = c(
seq(from = 1, to = 5, by = 1),
seq(from = 0.5, to = 2.5, by = 0.5),
seq(from = 0.25, to = 1.25, by = 0.25)
),
.C = c(
50, 100, 150, 200, 250,
75, 125, 175, 225, 275,
100, 150, 200, 250, 299
),
.Q = c(
rep(1500, 5),
rep(750, 5),
rep(375, 5)
)
)
fit = fit_photosynthesis(
.data = df,
.photo_fun = "r_light",
.model = "walker_ort_2015",
C_upper = 300,
Q_levels = c(1500, 750, 375)
)
test_that("walker_ort_2015 output", {
expect_is(object = fit, class = "lm")
})
df = data.frame(
.A = c(
seq(from = -3, to = -1.5, by = 0.5),
seq(from = -1.25, to = 1, by = 0.25)
),
.Q = c(seq(from = 0, to = 130, by = 10)),
.phiPSII = c(seq(from = 0.74, to = 0.61, by = -0.01))
)
fit = fit_photosynthesis(
.data = df,
.photo_fun = "r_light",
.model = "yin_etal_2011",
Q_lower = 0,
Q_upper = 130
)
test_that("yin_etal_2011 output", {
expect_is(object = fit, class = "lm")
})
|