GeomTimelineLabel: GeomTimelineLabel

Description Usage Format Value Examples

Description

This function creates a line from the center of the top deadly earthquake and label it with the location.

Usage

1

Format

An object of class GeomTimelineLabel (inherits from Geom, ggproto, gg) of length 6.

Value

Plots the n_max most deadly earthquakes from a given dataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Not run: 
# Creating a Dataset.
df_example <- eq_clean_data(file_name = 'inst/extdata/signif.txt') %>%
    dplyr::filter(YEAR > 2010,
                  COUNTRY %in% c("CHINA",
                                 "JAPAN")) %>%
            dplyr::select(DATE,
                          COUNTRY,
                          EQ_PRIMARY,
                          TOTAL_DEATHS,
                          LOCATION)


df_example %>%
   ggplot2::ggplot() +
       geom_timeline(aes(x = DATE,
                         y = COUNTRY,
                         size = EQ_PRIMARY,
                         color = TOTAL_DEATHS)) +
           ggplot2::layer(geom = GeomTimelineLabel,
                          mapping = aes(x = DATE,
                                        label = LOCATION,
                                        y = COUNTRY,
                                        mag = EQ_PRIMARY,
                                        color = TOTAL_DEATHS),
                          stat = 'identity',
                          position = 'identity',
                          show.legend = NA,
                          inherit.aes = TRUE,
                          params = list(na.rm = FALSE))
## End(Not run)

nandinigntr/MSDR documentation built on Jan. 1, 2021, 11:32 a.m.