Description Usage Arguments Value Examples
Adding label to Geom Timeline
1 2 3 4 5 6 7 8 9 10 |
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 |
This returns the geom timeline with label
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.