geom_timeline: Creates a new geom to graphically depict of timelines of...

Description Usage Arguments Examples

View source: R/module2.R

Description

Creates a new geom to graphically depict of timelines of earthquake events

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
geom_timeline(
  mapping = NULL,
  data = NULL,
  stat = "identity",
  position = "identity",
  na.rm = FALSE,
  xmin = NULL,
  xmax = NULL,
  show.legend = NA,
  inherit.aes = TRUE,
  ...
)

Arguments

data

A preproccessed tibble (data.frame) of NOAA earthquakes

xmin

a character vector indicating the mininum date specified for earthquakes time line plotting. Should follow the format of YYYY-MM-DD.

xmax

a character vector indicating the maximum date specified for earthquakes time line plotting. Should follow the format of YYYY-MM-DD.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
Capstone::noaa.data %>%
   Capstone::eq_clean_data() %>%
   dplyr::filter(COUNTRY %in% c("MEXICO", "INDONESIA", "CHINA")) %>%
   ggplot(aes(x = date, y = COUNTRY, label = LOCATION_NAME,group = COUNTRY, size = EQ_MAG_MW, fill = DEATHS/1000)) +
   geom_timeline(xmin = xmindate) +
   geom_timeline_label(n_max = 10, xmin = xmindate) +
   theme_classic()+ labs(y = "") +
   theme(legend.position = "bottom", axis.line.y = element_blank(), axis.ticks.y= element_blank())

## End(Not run)

shaowei72/RCapstone documentation built on Sept. 19, 2020, 3:37 p.m.