Description Usage Arguments Details Value Examples
The function draw the epicenters eartquakes (LATITUDE/LONGITUDE) from a filtered NOAA dataframe. Each point is annotates with an pop up window containing annotation data stored in a column of the data frame.
1 | create_map(df, content)
|
df |
A NOAA dataframe |
content |
a string vector which contains HTML code |
Using the columns from filtered frameframe, we create (for each location on the map) an HtML string (which is displayed in the pop-up window).
A leaflet object (a map)
1 2 3 4 5 6 7 8 9 10 11 12 | df <- load_data()
df <- eq_clean_data(df)
df <- eq_location_clean(df)
dff <- dplyr::filter(df, COUNTRY=="CHINA" & YEAR>=2010)
magnitude <- ifelse(is.na(dff$EQ_PRIMARY),4,dff$EQ_PRIMARY)
content <- paste("<b>Location:</b>", df$LOCATION_NAME,"<br/>",
"<b>Magnitude:</b>", df$EQ_PRIMARY,"<br/>",
"<b>Total deaths:</b>", df$TOTAL_DEATHS)
a <- create_map(dff, content)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.