replace_abbr <- function(title_chr,
abbreviations_lup,
collapse_lgl = T) {
title_chr <- title_chr %>%
strsplit(" ") %>%
purrr::flatten_chr() %>%
purrr::map_chr(~ {
match_lgl_vec <- .x == abbreviations_lup$short_name_chr
ifelse(match_lgl_vec %>%
any(),
ifelse(.x %in% abbreviations_lup$short_name_chr[match_lgl_vec],
ready4::get_from_lup_obj(abbreviations_lup,
match_value_xx = ifelse(.x == abbreviations_lup$short_name_chr[match_lgl_vec],
.x,
abbreviations_lup$short_name_chr[match_lgl_vec]
),
match_var_nm_1L_chr = "short_name_chr",
target_var_nm_1L_chr = "long_name_chr",
evaluate_1L_lgl = F
),
.x
),
.x
)
})
if (collapse_lgl) {
title_chr <- title_chr %>% paste0(collapse = " ")
}
return(title_chr)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.