Description Usage Arguments Value Examples
This function (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 2 3 |
filtered |
dataframe for any country and dates. |
This function returns a layer of plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
filename<-system.file("extdata","data.gz",package="NOAAA")
sample_USA <- readr::read_delim(filename, delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "USA" & lubridate::year(DATE) >= 2000)
ggplot(data = sample_USA, aes(x=DATE)) + geom_timeline() +
geom_timeline_label(data=sample_USA,aes(label=LOCATION_NAME),n_max=8) + theme_classic()
ggplot() +
geom_timeline_label(data=sample_USA,aes(x=DATE,label=LOCATION_NAME))
sample_2_countries<- readr::read_delim(filename, delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter((COUNTRY=="USA" | COUNTRY=="CHINA") & lubridate::year(DATE) >= 2000)
ggplot() +
geom_timeline_label(data=sample_2_countries,aes(x=DATE,y=COUNTRY,label=LOCATION_NAME))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.