#' artlookR Networks metadata
#'
#' There is only one set of \code{networks} 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 and levels (which are also the artlookR id numbers) for each \code{networks} value used in artlookR.
#' @details * Only Chicago uses the networks table because it's the only district with a Network structure.
#'
#' * You will need to run the \code{connection.R} script and create a connection object named \code{myconn} for this script to run.
#'
#' * The code orders the network names in a sensible way that is different than how artlookR stores them.
#' @examples meta_network()
#' @export
meta_networks <- function(...){
temp <- tbl(myconn, in_schema("public", "networks")) %>%
select(id, name) %>%
collect %>%
arrange(name) %>%
mutate(num = as.numeric(gsub("[^0-9]", "", name)),
nam = gsub("[0-9]", "", name)) %>%
arrange(nam, num)
output <- list(level = temp$id,
label = temp$name)
output
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.