Description Usage Arguments Aesthetics Examples
This function add labeling the top n
earthquakes, by
magnitude. Default value is the top 5 earthquakes for each country specified.
User can change this value n_max
aesthetic.
1 2 3 |
mapping |
see |
data |
see |
stat |
see |
position |
see |
na.rm |
see |
show.legend |
see |
inherit.aes |
see |
... |
other arguments. |
geom_timeline_label
undertands the following aesthetics (required
aesthetics are in bold):
x: recommend DATE
label: recommend LOCATION_NAME
magnitude: recommend EQ_PRIMARY
y: recommend COUNTRY
n_max: default 5. Top n
earthquakes to label,
sorted by magnitude.
color
linetype
size
alpha
NOAA_thm
GTL
1 2 3 4 5 6 7 8 9 10 11 12 | library(dplyr); library(lubridate);library(ggplot2)
NOAA_quakes%>%
eq_clean_data()%>%
dplyr::filter(COUNTRY %in% c('CHINA','MEXICO')) %>%
dplyr::filter(DATE > '2010-01-01') %>%
ggplot2::ggplot() +
geom_timeline(aes(x = DATE, y = COUNTRY, size = as.numeric(EQ_PRIMARY),
color = as.numeric(TOTAL_DEATHS))) +
guides(size = guide_legend(order=1))+
scale_color_continuous(name = '# deaths') +
scale_size_continuous(name = 'Richter scale value') +
NOAA_thm()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.