#' Apply variable class
#'
#' Ensure that fiscal year, cumulative, and targets are numeric and all other
#' variables are stored as characters.
#'
#' @param df dataframe output to reorder
#' @export
apply_class <- function(df){
#ensure variables are same class (problem when missing all targets)
df <- df %>%
dplyr::mutate(dplyr::across(dplyr::everything(), as.character),
dplyr::across(c(fiscal_year, cumulative, targets), as.double))
return(df)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.