I have a dataframe:
https://www.dropbox.com/s/51j3hh9urwjudu2/Agents.csv?dl=0
Using this, I can create a leaflet map using this code:
map = leaflet() %>%
addTiles() %>% # Add default OpenStreetMap map tiles
addCircles(lng = agents$longitude, lat = agents$latitude,
popup=paste("Agent:", agents$Agent, "<br>",
"Satisfaction:", agents$Satisfaction, "<br>",
"No. Customers:", agents$Customers, "<br>",
"Colour Ref:", agents$Colour),
radius = agents$Customers * 10,
color = agents$Colour,
stroke = FALSE, fillOpacity = 0.5)
which looks like this:
Now, I would like to:
have the first line in bold font (in this case 'Agent 4'). I have tried inserting:
"", agents$Agent, font = 2 "<br>",
but this does not work.
I would also like to tab 'Medium', '4200' and 'green' so that they are all in line with each other and so easier to read.
Does anyone know how to do this? Thank you!
I find it easier to create a new variable in the data frame for the popup text.
Here is an example.
agents$popup_text <-
paste0('<strong>', agents$Agent, '</strong>',
'<br/>', 'Satisfaction: ', '<strong>', agents$Satisfaction, '</strong>', ' ') %>%
lapply(htmltools::HTML)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With