Description Usage Format Value Parameters to Geom Examples
adding annotations to the 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.
1 |
An object of class GeomTimeLineLabel
(inherits from Geom
, ggproto
, gg
) of length 5.
for adding annotations to the earthquake data
x
: Time variable
label
: Factor for adding annotations to the earthquake data
y
: Factor indicating some stratification
n_max
: Number of earthquakes to subset according to their magnitude (EQ_PRIMARY)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
filename <- system.file("extdata", "signif.txt", package="earthquakeGeoms")
library(readr)
input <- readr::read_delim(filename, delim = "\t")
sample <- input %>%
eq_clean_data() %>%
eq_location_clean("LOCATION_NAME")%>%
filter(YEAR >= 2000) %>%
filter(COUNTRY %in% c("USA", "MEXICO"))
ggplot(data = sample, aes(x=date,y=COUNTRY, label=LOCATION_NAME)) +
geom_timeline() +
geom_timeline_label(data=sample,aes(label=LOCATION_NAME),n_max=8) +
scale_size_continuous(name = 'Richter scale value', guide = guide_legend(order = 1)) +
geom_timeline(aes(y = COUNTRY, color=DEATHS, size = EQ_PRIMARY)) +
scale_color_continuous(name = '# of Deaths', guide = guide_colorbar(order = 2)) +
new_theme()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.