Description Usage Arguments Value Examples
This function creates a plot showing earthquakes by date and country. It uses the GeomTimeline geom. The arguments are similar to those use in ggplot2 functions such as geom_point().
1 2 3 |
mapping |
An aesthetic mapping created by ggplot2::aes. |
data |
A data frame containing the data to be plotted. |
stat |
A string indicating the data transformation to be used. |
position |
A string giving the poistion adjustment. |
na.rm |
A logical controlling how missing values are handled. If FALSE, missing values are removed and a warning is printed, otherwise missing values are removed without a warning. |
show.legend |
A logical indicating whether the layer created by this function should have a legend. |
inherit.aes |
A logical. If FALSE, the default aesthetics are overridden. |
... |
additional arguments passed to the layer. |
This function adds an earthquake timeline plot to the current ggplot.
1 2 3 4 5 6 | eq_data <- eq_clean_data("NOAA_earthquakes.txt")
eq_data <- subset(eq_data, Country == "Mexico" & YEAR >= 2000)
ggplot2::ggplot(eq_data) +
geom_timeline(ggplot2::aes(x=DATE, y=Country, fill=TOTAL_DEATHS,
size=EQ_PRIMARY))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.