View source: R/lfcAllometries.R
allometries_calculate | R Documentation |
Return a vector with the desired allometry equation calculated
allometries_calculate(object, ..., allometry_id)
object |
|
... |
Must be named. Numeric vectors for the independent variables present in the allometry equation. Each argument must be named as the independent variable the values correspond with. See examples. |
allometry_id |
character with the unique allometry identifier |
Other Allometries functions:
allometries_description()
,
allometries_get_data()
,
allometries()
if (interactive()) {
library(dplyr)
allomdb <- allometries()
allometries_calculate(allomdb, DR = c(0.55, 0.46, 0.37), allometry_id = "BH_287")
# inside a dplyr mutate, with a different allometry for each species
iris_foo <- iris |>
mutate(allom = rep(c("BH_287","BH_288","BH_290"), each = 50)) |>
select(branch_diameter = Sepal.Length, Species, allom)
iris_foo
iris_foo |>
group_by(Species) |>
mutate(BH = allometries_calculate(
allomdb, DR = branch_diameter, allometry_id = first(allom)
))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.