geom_timelinelabel: Adding labels to a geom_timeline layer

Description Usage Arguments Value Examples

View source: R/geom_timeline.R

Description

Adding labels to a geom_timeline layer

Usage

1
2
3
geom_timelinelabel(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE, ...)

Arguments

mapping

aesthetic mappings

data

data to be visualized by the geom

stat

character. The statistical transformation to use on the data for this layer, as a string

position

character. Position adjustment, either as a string, or the result of a call to a position adjustment function

na.rm

logical. variable to indicate if NAs should be removed from the data

show.legend

logical. Should this layer be included in the legends? NA, the default, includes if any aesthetics are mapped. FALSE never includes, and TRUE always includes. It can also be a named logical vector to finely select the aesthetics to display.

inherit.aes

logical. If FALSE, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn't inherit behaviour from the default plot specification.

...

Other arguments passed on to the layer

Value

Returns a layer, a combination of data, stat and geom objects including labels for certain data-points.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#
## Not run: 
data <- readr::read_delim("signif.txt", delim = "\t")
data <- eq_clean_data(data)
data %>%
dplyr::filter(COUNTRY == c("USA","CHINA") & lubridate::year(DATE) >= 2008) %>%
 ggplot(aes(x=DATE,y=COUNTRY,color=TOTAL_DEATHS,size=EQ_PRIMARY)) +
 geom_timeline(alpha=.5) +
 geom_timelinelabel(aes(label=LOCATION_NAME),n_max=3) +
 theme(legend.position="bottom", legend.box="horizontal", plot.title=element_text(hjust=0.5)) +
 ggtitle("Earthquakes Visualization Tool") +
 labs(size = "Richter scale value", color = "# Deaths")


## End(Not run)

mkaywins/Capstone_project documentation built on Feb. 24, 2020, 8:36 p.m.