geom_timeline_label: Adding label to Geom Timeline

Description Usage Arguments Value Examples

View source: R/geom_label.R

Description

Adding label to Geom Timeline

Usage

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

Arguments

mapping

set aesthetics

data

provide the dataframe of the labels

stat

Any statistics

position

Position of the label

...

Other arguments that can be passed

na.rm

TRUE if you want to remove the missing and False if not

show.legend

TRUE to show legend

inherit.aes

Basically inherit the aesthetics or not

Value

This returns the geom timeline with label

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
labels <- NOAA_data %>% eq_clean_data() %>%
dplyr::filter(Country %in% c("India", "Pakistan"))%>%
   filter(date> ymd('2000-01-01') & date <ymd('2015-12-31'))%>%
  top_n(5,Mag)

NOAA_data %>% eq_clean_data() %>%
   dplyr::filter(Country %in% c("Pakistan", "India")) %>%
   ggplot(aes(x = date, y = Country, color = Total.Deaths, size = Mag,
              magnitude = Mag, label =Location_Name)) +
   geom_timeline(alpha=0.4,xmin = ymd('2000-01-01'), xmax = ymd('2015-12-31'))+
   geom_timeline_label(data = labels,
                       mapping = aes(x = date, y = Country, label = Location_Name))+
   labs(color="#deaths",size="Richter scale value",x="DATE")+
   theme_minimal()
   
## End(Not run)

adeel1997/noaaquake documentation built on Dec. 18, 2021, 10:27 p.m.