R/meta_engagement_types.R

Defines functions meta_engagement_types

Documented in meta_engagement_types

#' artlookR engagement_types metadata
#'
#' There is only one set of \code{engagement_type}s used across the entire artlookR platform (i.e., this table is listed in the
#' \code{public} schema). Because of that there is no requirement in this function to identify a \code{comm_name}.
#' @return A list with the label names, levels, artlookR id numbers for each \code{engagement_type} used in artlookR.
#' @details * There is, at present, no \code{display_name} variable in the table.
#'
#'  * You will need to run the \code{connection.R} script and create a connection object named \code{myconn} for this script to run.
#' @examples meta_engagement_types()
#' @export
meta_engagement_types <- function(...){

  temp <- tbl(myconn, in_schema("public", "engagement_types")) %>%
    arrange(id) %>%
    collect

  output <- list(label = str_to_title(str_replace_all(temp$name, "_", " ")),
                 level = temp$name,
                 id = temp$id)

  output

}
Ingenuity-Inc/artlookR documentation built on May 18, 2022, 12:33 a.m.