#' @name get_ED_default_pft
#' @title get_ED_default_pft
#' @author FĂ©licien Meunier
#' @export
#' @description Returns default parameter
#' @param xml xml (ED2)
#' @param var varname (ED2)
#' @param pft_target pft num (ED2)
get_ED_default_pft <- function(xml, var, pft_target = NULL){
history_xml <- XML::xmlParse(xml)
history_list <- XML::xmlToList(history_xml)
if (!is.null(pft_target)){
pft <- 0
while (pft != pft_target){
pft <- history_list %>% .[["pft"]] %>% .[["num"]] %>% str_replace("/n", "") %>% str_trim() %>% as.numeric()
if (pft != pft_target){
history_list$pft <- NULL
}
}
}
out <- history_list %>% .[["pft"]] %>% .[[var]] %>% str_replace("/n", "") %>% str_trim() %>% as.numeric()
return(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.