Description Usage Arguments Value Examples
View source: R/geom_timeline.R
This function plots a timeline of earthquakes
1 2 3 4 5 6 7 8 9 10 |
mapping |
Set of aethetics created by aes |
data |
A filtered data frame |
stat |
A string of statistical transformation |
position |
A string of position adjustment |
na.rm |
logical; if FALSE (default) NA values are not removed |
show.legend |
logical; for showing a legend |
inherit.aes |
logical; if TRUE (default) default aesthetics are overridden |
... |
Other arguments including x for the column name for DATE, xmin for the beginning date and xmax for the end date of the timeline |
geom_timeline returns a layer for plotting the GeomTimeline object.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
Countries <- c('USA', 'CHINA')
XMin <- ymd('2000-01-01')
XMax <- ymd('2020-01-01')
readr::read_delim(system.file("extdata", "signif.txt", package = "TheCapstoneProject"), delim = '\t') %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY %in% Countries) %>%
ggplot2::ggplot() +
geom_timeline(aes(x = DATE, xmin = XMin, xmax = XMax, y = COUNTRY, size = EQ_PRIMARY, color = TOTAL_DEATHS)) +
labs(x = 'DATE', y = 'COUNTRY', color = '# deaths', size = 'Richter scale value') +
lims(x = c(XMin, XMax))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.