add_weather {owmr} | R Documentation |
Add weather data to leaflet map.
Description
Add weather data to leaflet map.
Usage
add_weather(map, data, lng = NULL, lat = NULL, icon = NULL,
template = NULL, popup = NULL, ...)
Arguments
map |
|
data |
owm data |
lng |
numeric vector of longitudes
(if |
lat |
numeric vector of latitudes
(if |
icon |
vector of owm icon names (usually included in weather column of owm data) |
template |
template in the form of |
popup |
vector containing (HTML) content for popups,
skipped in case parameter |
... |
see |
Value
updated map object
Examples
## Not run:
owm_data <- find_city("Malaga", units = "metric") %>%
owmr_as_tibble()
map <- leaflet() %>% addTiles() %>%
add_weather(
owm_data,
template = "<b>{{name}}</b>, {{temp}}°C",
icon = owm_data$weather_icon
)
## End(Not run)
[Package owmr version 0.8.2 Index]