Closed dfalster closed 1 year ago
Tidy outputs should enable easier calculation of garages values for output
In general, we want to calculate 3 types of output
This should be easier with tidy outputs. E.g. for no 2 above
patch_species_total <- function(data) {
data %>%
select(-cohort) %>% na.omit() %>%
filter(step > 1) %>%
group_by(step, time, patch_density, species) %>%
summarise(
individuals = -plant:::trapezium(height, density),
across(c(starts_with("area"), starts_with("mass")), ~ -plant:::trapezium(height, density*.x)),#, .names = "{.col}_tot"),
.groups="drop"
)
}
Then
run_scm_collect() %>% tidy_patch() %>% patch_species_total()
The outputs of
run_scm_collect
are not particularly user friendly.suggest tidying into tidy data format, organising by cohort and species.
Here is a prototype
Could even become the default for scm, or an option in scm