#' artlookR program_types metadata
#'
#' There is only one set of \code{program_types} 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{program_types} value used in artlookR. Additionally,
#' returns \code{impact_level} and \code{impact_label}, which identify each program type as high, medium, or low impact based on Ingenuity's definitions.
#' @details * You will need to run the \code{connection.R} script and create a connection object named \code{myconn} for this script to run.
#'
#' * This code re-orders the labels because the default ID order in the database is not the one that is typically required.
#' @examples meta_program_types()
#' @export
meta_program_types <- function(...){
posit <- tibble(position = c(1,2,3,4,5,6,7,8),
name = c("professional_development",
"resources",
"field_trip",
"out_of_school_time",
"in_school_performance",
"residency",
"online",
"other"))
temp <- tbl(myconn, in_schema("public", "program_types")) %>%
collect %>%
left_join(posit) %>%
arrange(position)
output <- list(label = case_when(is.na(temp$display_name) ~ str_to_title(str_replace_all(temp$name, "_", " ")),
TRUE ~ temp$display_name),
level = temp$name,
id = temp$id,
impact_label = c("High Impact", "Low Impact", "Low Impact", "High Impact", "Low Impact", "Medium Impact", "Low Impact"),
impact_level = temp$name)
output
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.