Description Usage Arguments Value Examples
This is a method of creating a graph that maps earthquake data along the timeline.
The date should be specified as the x
parameter, the size of the earthquake
as the size
parameter (this is optional), the numberof deaths as the color
parameter (this is optional) and the group
parameter to indicate how the data
should be groups (this is optional).
1 2 3 |
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this layer, as a string. |
position |
Position adjustment, either as a string, or the result of a call to a position adjustment function. |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
other arguments passed on to |
This function returns a graphic object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(dplyr)
library(ggplot2)
library(readr)
raw_data<-readr::read_tsv(system.file("extdata", "signif.txt", package = "RCapstone"))
clean_data<-eq_clean_data(raw_data) %>% eq_location_clean() %>%
dplyr::filter(!is.na(EQ_PRIMARY), !is.na(DEATHS)) %>%
ggplot2::ggplot() +
ggplot2::aes(
x = DATE,
size = EQ_PRIMARY,
colour = DEATHS,
label=LOCATION_NAME
) +
geom_timeline()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.