Description Usage Arguments Value Examples
This function creates a new geom to create a timeline for a specified data range and plots each earthquake as a point on that timeline
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. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed on to |
plot of a timeline of earthquakes in one line with options to group by country, color by number of casualties and size by scale. Size corresponds to the Richter Magnitude of the earthquake.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
data %>% eq_clean_data() %>%
filter(COUNTRY %in% c("USA", "CHINA"), YEAR >= 2000) %>%
ggplot(aes(x = DATE,
y = COUNTRY,
color = as.numeric(TOTAL_DEATHS),
size = as.numeric(EQ_PRIMARY)
)) +
geom_timeline(alpha = 0.2) +
theme_timeline() +
labs(size = "Richter scale value", color = "# deaths")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.