R/fact_table.R

Defines functions set_fact_name.fact_table set_fact_name

Documented in set_fact_name set_fact_name.fact_table

# set_fact_name ------------------------------------------------------

#' Set fact name
#'
#' It allows us to define the name of facts.
#'
#' Attributes can be accessed directly but this function has been defined
#' because it is used from other classes and is thus done in a more controlled
#' way.
#'
#' @param ft A `fact_table` object.
#' @param name A string, name of fact.
#'
#' @return A `fact_table` object.
#'
#' @keywords internal
set_fact_name <- function(ft, name) {
  UseMethod("set_fact_name")
}


#' @rdname set_fact_name
#' @export
#' @keywords internal
set_fact_name.fact_table <- function(ft, name) {
  attr(ft, "name") <- name
  ft
}

Try the starschemar package in your browser

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

starschemar documentation built on Nov. 11, 2023, 5:09 p.m.