fmt_school_name_short | R Documentation |
Standard grade range names are replaced with corresponding abbreviations
("E","EM","M","H","MH", and "P"). For example, "High" (appearing at the end
of a string), "High school" or "High School" is replaced by HS (or H if
suffix is NULL
). String or column values are also passed to
stringr::str_squish()
and stringr::str_trim()
to avoid issues with
pattern matching failing due to trailing spaces or double-spaces.
fmt_school_name_short(
data,
.col = "school_name",
.col_short = NULL,
suffix = "S",
extra_pattern = c(`All Baltimore City Public Schools` = "All City schools", Academy =
"Acad.", Preparatory = "Prep.", Square = "Sq.", `^Commodore` = "Com.", `, The$` = "")
)
vec_fmt_school_name_short(
string,
suffix = "S",
extra_pattern = c(`All Baltimore City Public Schools` = "All City schools", Academy =
"Acad.", Preparatory = "Prep.", Square = "Sq.", `^Commodore` = "Com.", `, The$` = "")
)
data |
Data frame with column name matching .col that contains school names to shorten. |
.col |
Column name to shorten. Values are replaced if .col_short is supplied. |
.col_short |
Column name for new column with short names. |
suffix |
Suffix to append to standard abbreviations. Defaults to "S" |
extra_pattern |
Additional replacements added to standard pattern and
passed to |
string |
Character vector of school names to shorten. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.