Description Usage Arguments Value Note Examples
This geom plots a timeline of dates (requires x
date
aesthetics) in one or more lines (depending on optional y
aesthetics
to group data by selected variable). Furthermore size and colour can be
linked to numeric variables.
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. |
... |
other arguments passed on to |
na.rm |
If |
xmin |
A date. If used the plot will start from this date |
xmax |
A date. If used the plot will end at this date |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
Grob representing timeline(s) and datapoints
required_aes x date of data points to be plotted
default_aes y, size, colour with y=0.1, size=3, colour="grey"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
eq_data %>% eq_clean_data() %>%
filter(COUNTRY %in% c("GREECE", "ITALY"), year(DATE) > 2000) %>%
ggplot(aes(x = DATE,
y = COUNTRY,
color = TOTAL_DEATHS,
size = EQ_PRIMARY)) +
geom_timeline() +
geom_timeline_label(aes(label = LOCATION), n_max = 8) +
theme_timeline() +
scale_size(name = "Richter scale", limits = c(5, 8)) +
scale_color_gradient(name = "# Deaths", low = "black", high = "blue")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.