Description Usage Arguments Examples
View source: R/geom_timeline_label.R
geom_timeline_label
enables you to label the n biggest earthquakes
based on the Richter scales by means of n_max
arguments.
1 2 3 4 5 6 7 8 9 10 |
mapping |
Set of aesthetis mappings created by |
data |
The data to be displayed in this layer. |
stat |
Override the default connection between |
position |
Position adjustment, either as a string, or the result of a call to position adjustment function. |
show.legend |
logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes. It can also be a named logical vector to finely select the aesthetics to display. |
na.rm |
If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed. |
inherit.aes |
If FALSE, overrides the default aesthetics, rather than combining with them. |
... |
Other arguments passed on to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
NOAA_data <- NOAA_data %>%
eq_clean_data() %>%
eq_location_clean() %>%
dplyr::filter(Country %in% c("MEXICO", "IRAN") &
Date %within% lubridate::interval(ymd(20000103), ymd(20180104))) %>%
dplyr::mutate(Country = factor(Country, levels = unique(Country))) %>%
ggplot2::ggplot() +
geom_timeline(ggplot2::aes(x = Date, y = Country, size = Mag, colour = Deaths)) +
geom_timeline_label(ggplot2::aes(x = Date, y = Country, label = Location,
magnitude = Mag, colour = Deaths, n_max = 7), alpha = 0.5) +
ggplot2::scale_colour_continuous(name = "# deaths") +
ggplot2::theme(legend.position = "bottom") +
ggplot2::ylab("")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.