R/get_param.R

Defines functions get_param.fFITs get_param

Documented in get_param get_param.fFITs

#' Get parameters from curve fitting result
#'
#' @param fits Multiple methods curve fitting results by `curvefits` result.
#' @inheritParams get_GOF
#'
#' @example inst/examples/ex-get_fitting_param_GOF.R
#' @export
get_param <- function(fits){
    lapply(fits, get_param.fFITs) %>%
        purrr::transpose() %>%
        map(~map_df(., ~ .x, .id = "flag")) # could improve
}

#' @rdname get_param
#' @export
get_param.fFITs <- function(fFITs){
    map(fFITs$fFIT, ~.x[["par"]] %>% as_tibble())
}
eco-hydro/phenofit2 documentation built on Dec. 20, 2021, 3:15 a.m.