Description Usage Arguments Value Note Examples
This function adds a geom which displays a timeline for NOAA earthquake data. This is the basic timeline visualization without additional modifications. For a cleaner visualization the wrapper function, eq_time, should be used.
1 2 3 |
mapping |
A set of aesthetic mappings. If null, uses the default setting in ggplot() |
data |
A dataset If null, uses the default data specified in ggplot() |
stat |
The name of the statistical transformation to use. Identity means keep the data as is. |
position |
The method used to adjust overlapping objects. Identity means keep the position as is. |
na.rm |
Flag to remove values with NA |
show.legend |
Flag to say whether layer should be present in legend. |
inherit.aes |
Flag to say whether default aesthetics should be inherited. |
... |
Additional arguments passed to layer() |
This function returns a layer that can be added to a plot using the ggplot function
The parameters for GeomTimeLine include columns from the earthquake data: Required parameters: x=DATE Optional parameters: y=COUNTRY,size=EQ_PRIMARY,color=DEATHS,alpha=x where x is a number from 0 to 1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
readr::read_delim(filename, delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter(COUNTRY == "USA" & lubridate::year(DATE) >= 2000) %>%
ggplot() +
geom_timeline(aes(x=DATE,size=EQ_PRIMARY,color=DEATHS),alpha=0.5)
readr::read_delim(filename, delim = "\t") %>%
eq_clean_data() %>%
dplyr::filter((COUNTRY=="USA" | COUNTRY=="CHINA") & lubridate::year(DATE) >= 2000) %>%
ggplot() +
geom_timeline(aes(x=DATE,y=COUNTRY,size=EQ_PRIMARY,color=DEATHS),alpha=0.5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.