R/prettify_instrument.R

Defines functions .prettify_nnbsbtl prettify_instrument

Documented in prettify_instrument

#' Prettify instrument
#'
#' Renames columns and applies labels as needed to make the data easier to read.
#' This is not called automatically like .preprocess() and .postprocess(), and
#' so is done on an as-needed basis.
#'
#' @param inst_data Instrument data
#' @param inst_prefix Instrument prefix
#'
#' @return The instrument data frame but with various things manually renamed
#' to make them easier to read
#' @export
prettify_instrument <- function(inst_data, inst_prefix) {
  fx_name <- paste0(".prettify_", inst_prefix)
  if (methods::existsFunction(fx_name)) {
    do.call(fx_name, args = list(inst_data))
  } else {
    return(inst_data)
  }
}

.prettify_nnbsbtl <- function(inst_data) {
  # Rename columns for nnb subtotal column
}
tsostarics/anrlab documentation built on Nov. 6, 2022, 3:54 a.m.