Description Usage Arguments Details Examples
Actual function that draw the earthquake timeline label
1 2 3 |
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If |
n_max |
A integer describing the maximum numer of labels to display |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments passed on to |
In a typical use case, the x aesthetic is already inherited from the previous layer, the user only have to specify the dimension to be used as label, as well as the maximum number of labels to be displayed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
read_eq_clean_data() %>%
dplyr::filter(YEAR > 2000 & !IS_BC & COUNTRY %in% c("USA", "CANADA")) %>%
dplyr::mutate(TOTAL_DEATHS = as.numeric(TOTAL_DEATHS),
EQ_PRIMARY = as.numeric(EQ_PRIMARY)) %>%
ggplot2::ggplot(ggplot2::aes(x = DATE,
y = COUNTRY,
colour = TOTAL_DEATHS,
size = EQ_PRIMARY
)) +
geom_timeline() +
theme_timeline() +
labs(size = "Richter scale value", color = "# deaths") +
geom_timeline_label(ggplot2::aes(label = LOCATION_NAME), n_max = 3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.