create_map: create_map

Description Usage Arguments Details Value Examples

Description

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.

Usage

1
create_map(df, content)

Arguments

df

A NOAA dataframe

content

a string vector which contains HTML code

Details

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).

Value

A leaflet object (a map)

Examples

 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)

constantin345/NOOA documentation built on May 16, 2019, 7:09 p.m.