## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
has_ggplot2 <- requireNamespace("ggplot2", quietly = TRUE)

## ----eval = !has_ggplot2, echo = FALSE, results = "asis"----------------------
# cat(
#   "This article needs the `ggplot2` package, which is not installed. ",
#   "Install it and rebuild the vignette to see the full walkthrough.",
#   sep = ""
# )

## ----eval = has_ggplot2, fig.width = 8, fig.height = 5.5----------------------
library(contentiousR)

plot_regional_coverage(
  datasets      = c("navco1.3", "navco2.1", "beissinger", "csra", "mec"),
  start_year    = 1950,
  end_year      = 2013,
  coding_system = "cow"
)

## ----eval = has_ggplot2, fig.width = 8, fig.height = 5.5----------------------
plot_temporal_coverage(
  datasets      = c("navco1.3", "navco2.1", "beissinger", "csra", "mec"),
  start_year    = 1950,
  end_year      = 2013,
  coding_system = "cow"
)

## ----eval = has_ggplot2, fig.width = 9, fig.height = 6.5----------------------
plot_temporal_coverage(
  datasets      = c("navco1.3", "navco2.1", "beissinger", "csra", "mec"),
  start_year    = 1950,
  end_year      = 2013,
  coding_system = "cow",
  by_region     = TRUE
)

## ----eval = has_ggplot2, fig.width = 8, fig.height = 5.5----------------------
plot_regional_coverage(c("navco1.3", "navco2.1"), 1950, 2013, metric = "count")

