R/apply_act_predict.R

Defines functions apply_act_predict

Documented in apply_act_predict

#' Apply act_prediction function
#' @description helper function for simulating grassland condition under management
#' @details Applies act_predict and initialise_condition functions and records the outputs in a dataframe
#' @param strategies_df A dataframe of strategies
#'
#' @return strategies_df A dataframe with the outcoems of simulated management at the end of the specified time horizon
#' @export
#' @import purrr
#' @import dplyr
apply_act_predict <- function(strategies_df, time_slice){
        strategies_df <- strategies_df %>%
                dplyr::as_tibble() %>%
                dplyr::rename(action_set_number = value)
        strategies_df <- strategies_df %>%
                dplyr::mutate(condition_horizon = purrr::map(.x = action_set_number,
                                                             .f = act_predict,
                                                             nodes = management_nodes, time_slice = time_slice))
        return(strategies_df)
}
egouldo/GrasslandAllocatr documentation built on Oct. 19, 2022, 8:18 a.m.