Produces an object suitable to pass as the funcresp
to spec_rescomp()
.
Creates a linear or type 1 functional response with attack rate a
.
mu_ij(R_j) = a_ij * R_j
funcresp_type1(a)
S3 object of class rescomp_funcresp
.
funcresp1 <- funcresp_type1(
matrix(c(0.2, 0.4, 0.3, 0.2), nrow = 2)
)
get_funcresp(funcresp1, 2, c(10, 20), list())
#> [,1] [,2]
#> [1,] 2 6
#> [2,] 4 4
funcresp2 <- funcresp_type1(
rescomp_coefs_lerp(
matrix(c(0.2, 0.4, 0.3, 0.2), nrow = 2),
matrix(c(0.2, 0.1, 0.3, 0.1), nrow = 2),
"antibiotic_concentration"
)
)
get_funcresp(funcresp2, 2, c(10, 20), list(antibiotic_concentration = 0.5))
#> [,1] [,2]
#> [1,] 2.0 6
#> [2,] 2.5 3