View source: R/label_standardize.R
label_output | R Documentation |
Wrapper for label_standardize and label_html, to create labels for a leaflet map in one step. Object p assigned within label_output function to enable easier line breaks in glue function.
label_output(df, label_text)
df |
Dataframe to create labels from |
label_text |
Text fed to glue function to create labels using columns in dataframe. For the glue function, an object p is defined to be "<p></p>" for easier line breaks |
List of strings corresponding to length of dataframe, supplied to leaflet function
labs <- "Ward name: {WARD} Area: {Area}" map <- leaflet::leaflet(leafletwrappers::wards) leaflet::addPolygons(map, label = label_output(leafletwrappers::wards, labs))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.