Description Usage Format Value Examples
This function creates a line from the center of the top deadly earthquake and label it with the location.
1 |
An object of class GeomTimelineLabel
(inherits from Geom
, ggproto
, gg
) of length 6.
Plots the n_max most deadly earthquakes from a given dataset.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.