Description Usage Arguments Value Examples
geom_timeline_label is used for adding annotations to NOAA earthquake data. "This geom adds a vertical line to each data point with a text annotation (e.g. the location of the earthquake) attached to each line. There should be an option to subset to n_max number of earthquakes, where we take the n_max largest (by magnitude) earthquakes. Aesthetics are x, which is the date of the earthquake and label which takes the column name from which annotations will be obtained." (Mastering Software Development in R Capstone, Week 2)
1 2 3 |
mapping |
aesthetic mappings |
data |
The datafram to create a timeline for |
stat |
The stat to transform the data with, by default "identity" |
position |
Adjusts the position of the layer in the grob |
na.rm |
If FALSE, the default, missing values are removed with a warning. If TRUE, missing values are silently removed. |
show.legend |
Display legends |
inherit.aes |
Should the aes be inherited |
... |
Other args |
a ggplot timeline object with labels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
paste0("https://www.ngdc.noaa.gov/",
"nndc/struts/results?type_0=Exact&",
"signif.txtquery_0=$ID&t=101650&s=13&",
"d=189&dfn=signif.txt") %>%
readr::read_delim(delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY = "ANTARTICA") %>%
ggplot2::ggplot(aes(x = DATE, Y = COUNTRY)) +
geom_timeline() +
geom_timeline_label(aes(label = LOCATION_NAME),
n_max = 5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.