Description Usage Arguments Details Examples
geom_timeline_label
generates labels for earthquakes on a timeline plot. Used along with geom_timeline
.
1 2 |
mapping |
mapping |
data |
data |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
remove NAs |
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. |
inherit.aes |
If 'FALSE', overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification, e.g. [borders()]. |
... |
other parameters |
It uses the following additional parameters:
integer. Top earthquakes with respect to the magnitude. These earthquakes are labelled on the plot.
character vector. A column in the NOAA dataset used for labelling the data points.
1 2 3 4 5 6 7 8 | data("eq_data")
ggplot(data = eq_data %>% filter(COUNTRY %in% c('COLOMBIA', 'MEXICO', 'USA')),
aes(x = DATE, y = COUNTRY, size = EQ_PRIMARY,
color = TOTAL_DEATHS, xmin = as.Date('1970-01-01'),
xmax = as.Date('2015-01-01'))) +
geom_timeline_label(aes(label = as.character(DATE)), nmax = 2) +
geom_timeline() +
theme_eq
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.