Description Usage Arguments Examples
Function for truncating a text field designed to aid labelling a map This function returns a character string
1 | trunc_labs(string)
|
string |
the string you want truncating |
1 2 3 4 5 6 | sites_lab <- sites_lab %>% mutate(latitude = as.numeric(st_coordinates(sites_lab)[,1]),
longitude = as.numeric(st_coordinates(sites_lab)[,2]),
SiteNam = as.character(SiteNam),
SiteNam = str_replace_all(SiteNam, " and ", " & "),
SiteNamShort = case_when(nchar(SiteNam) > 40 ~ trunc_labs(SiteNam),
TRUE ~ SiteNam))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.