# Create new label data set
labels <- add_label_text(region = "A",
year = -50,
position = 0.5,
label = "Flood",
new = TRUE)
# Add labels to existing data set
labels <- add_label_text(data = labels,
region = "B",
year = 50,
position = 0.9,
label = "Earthquake",
new = FALSE)
# They can be linked using the pipe operator \code{%>%}:
library(magrittr)
labels <- add_label_text(region = "A",
year = -50,
position = 0.5,
label = "Flood",
new = TRUE) %>%
add_label_text(region = "B",
year = 50,
position = 0.9,
label = "Earthquake")
Run the code above in your browser using DataLab