Description Usage Arguments Details Examples
Timeline earthquake graph
1 2 3 |
mapping |
Set of aesthetics created by aes. |
data |
A data.frame such as that obtained from NOAA |
stat |
A string of statistical transfromation. |
position |
Position adjustment. |
na.rm |
A logical expression for dealing with missing values. |
show.legend |
A logical expression for showing legend or not. |
inherit.aes |
A logical expression of whether or not override default aesthetics. |
... |
Other arguments passed to layer |
A timeline plot is a representation of individual earthquakes ordered by their corresponding dates as points; the color of the point represent the number of deaths that resulted from the event and the size represents the magnitude of the event.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
# load and clean data
file_path <- system.file("data", "dt.tsv", package = "PCR")
dt <- read_tsv(file_path) %>%
eq_clean_date %>%
eq_clean_location
# make graph
dt %>%
filter(COUNTRY == 'MEXICO') %>%
ggplot(aes(date = date,
xmin = as.Date('1995-01-01'),
xmax = as.Date('2000-12-30'),
y = COUNTRY,
colour = DEATHS,
fill = DEATHS,
size = EQ_PRIMARY,
location = LOCATION)) +
geom_timeline() +
geom_timeline_label() +
theme(axis.line.y = element_blank(),
axis.line.x = element_line(),
axis.ticks.y = element_blank(),
axis.text.y = element_blank(),
axis.title.y = element_blank(),
legend.position = 'bottom',
panel.grid = 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.