Description Usage Arguments Details See Also Examples
View source: R/geom_timeline_label.R
Add text labels to timeline visualization via geom_timeline
of earthquakes.
1 2 3 4 5 6 7 8 9 10 11 |
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 FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
n_max |
(integer) Number of labels to be drawn per group. |
... |
Other arguments passed to ggplot2::layer |
Count of labels by group is controlled by n_max
where top n_max earthquakes ordered by magnitude are used.
For label text mapping of label
is expected.
### Aesthetics
geom_timeline_label requires the following aesthetics:
yGrouping variable by which visualization is split (usually COUNTRY)
labelLabel text (e.g. LOCATION_NAME)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
noaa_data <- system.file("extdata", "noaa_earthquakes.tsv", package = "noaa") %>%
eq_read_data %>%
eq_clean_data %>%
filter(COUNTRY %in% c("USA", "CHINA") & YEAR > 2000)
timeline <- noaa_data %>%
plot_eq_timeline(label = NULL)
timeline +
geom_timeline_label(data = noaa_data,
mapping = aes(y = COUNTRY, label = LOCATION_NAME), n_max = 6)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.