R/post_process_sarosplot_data.R

Defines functions post_process_makeme_data

post_process_makeme_data <- function(data,
                                        indep = NULL,
                                        showNA = "never",
                                        colour_2nd_binary_cat = NULL) {

  if (length(indep) > 0) {
    data[[indep]] <- forcats::fct_rev(data[[indep]])
  }

  if (dplyr::n_distinct(data$.category, na.rm = showNA == "never") == 2 &&
      !is.null(colour_2nd_binary_cat)) {
    data$.category <- forcats::fct_rev(data$.category)
  }
  data
}

Try the saros package in your browser

Any scripts or data that you put into this service are public.

saros documentation built on June 8, 2025, 10:43 a.m.