Description Usage Arguments Value Examples
This function receives the ggplot2 parameters plus the Geom Timeline to add the earthquakes timeline layer in a ggplot2 object
1 2 3 4 5 6 7 8 9 10 |
mapping |
Set of aesthetic mappings created by aes() or aes_(). |
data |
The data to be displayed in this layer. |
stat |
Previous calculation to prepare dataframe to be plotted |
position |
Position adjustment. Could be a string or the result of a call to a position adjustment function. |
na.rm |
If FALSE, the default, missing values are mremoved with a warning. If TRUE, missing values are silently removed. |
show.legend |
logical. Should this layer be included in the legends? NA, the default, incldes if any aesthetics are mapped. False never includes, and TRUE always includes. |
inherit.aes |
If FALSE, overrides the default aesthetics, rather than combining with them. This is most usefule for helper functions that define both data and aesthetics and shouldn't inherit behavior from the default plot specification, e.t. borders. |
... |
Other arguments passed on layer like color = "red" or size = 3. |
The layer containing the elements created with Geom GeomTimeline
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
readr::read_delim("earthquakes.txt", delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY %in% c("CHINA", "USA") & lubridate::year(DATE) >= 2000) %>%
ggplot2::ggplot(ggplot2::aes(x = DATE, y = COUNTRY, size = EQ_PRIMARY, colour = DEATHS)) +
geom_timeline() +
geom_timeline_label(ggplot2::aes(label = LOCATION, n_max = 6)) +
xlab("Date") + ylab("") +
labs(size = "Richter scale", color = "# deaths" ) +
theme(axis.line.y=element_blank(),panel.background=element_blank())
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.