Description Usage Arguments Details Value Examples
View source: R/geom_timeline_label.R
This function creates a new geom that can build on geom_timeline and add labels to the top n biggest earthqakes by magnitude
1 2 3 |
mapping |
defaults to NULL |
data |
defaults to NULL, unless data passed in |
stat |
defautls to 'identity' |
position |
defautls to 'identity' |
na.rm |
defaults to FALSE, do not remove NAs |
show.legend |
defaults to NA |
inherit.aes |
defaults to TRUE |
... |
takes additional arguments |
Create a new geom called geom_timeline_label that is used to plot relevant top_n labels on geom_timeline
Returns a ggplot object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run: data %>%
ggplot() +
geom_timeline(aes(
x = DATE,
y = COUNTRY,
fill = TOTAL_DEATHS,
size = EQ_PRIMARY)) +
geom_timeline_label(aes(
x = DATE,
y = COUNTRY,
magnitude = EQ_PRIMARY,
label = LOCATION_NAME
,n_max=3 #number of lables to show))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.