Description Usage Arguments Details Value Examples
eq_timeline
is a function to easily create a timeline plot with or
without labels using NOAA Significant Earthquake data.
1 2 | eq_timeline(df, countries = "USA", date_min = "2000-01-01",
date_max = "2018-01-01", label_n = 0)
|
df |
The cleaned earthquake data to timeline. See
|
countries |
Default |
date_min |
Default |
date_max |
Default |
label_n |
Default |
This function is a wrapper function that makes it easy to create a timeline
plot of the NOAA Significant earthquakes for a given country or countries. It
also allows the user to specify (or not!) the number of earthquakes to label.
This function makes it easy to use the recommended defaults for
geom_timeline
, geom_timeline_label
, and
theme_eq
. The benefit of using this function is that it
saves the user a significant amount of typing and data filtering, though
it gives up control in specifics of how the timelines are displayed.
A ggplot2
object, showing the earthquake timeline.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # An example with a single country and no labels, showing two
# different classes of date* parameters being passed in.
library(ggplot2); library(dplyr)
quakes <- eq_load_clean_data()
quakes %>% eq_timeline(countries = 'USA', date_min = as.Date('1995-01-01'),
date_max = as.POSIXct('2015-01-01'), label_n = 0)
# An example with multiple countries and 5 labels per country.
quakes <- eq_load_clean_data()
quakes %>% eq_timeline(countries = c('JAPAN', 'INDONESIA', 'HAITI'),
date_min = '2000-01-01', date_max = '2017-01-01',
label_n = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.