label_html: Turn Labels into HTML

View source: R/label_standardize.R

label_htmlR Documentation

Turn Labels into HTML

Description

A function to convert a character vector of labels for a leaflet map into a list with HTML applied to each element

Usage

label_html(label_vec)

Arguments

label_vec

A character vector of labels corresponding to the length of the mapped dataframe

Value

A list with HTML applied to each element of the character vector

Examples

labs <- label_standardize(leafletwrappers::wards, "Ward name: {WARD}<p></p> Area: {Area}")

map <- leaflet::leaflet(leafletwrappers::wards)
leaflet::addPolygons(map, label = label_html(labs))

dpowerstp/leafletwrappers documentation built on Sept. 4, 2022, 10:19 a.m.