#' Check if an Object is a [ggplot2] Plot
#'
#' @description
#' Use in tests to check if an object is a [ggplot2::ggplot] object.
#'
#' @param x [ggplot2::ggplot] object
#'
#' @note borrowed from `bayesplot:::expect_gg`
#'
expect_gg <- function(x) {
testthat::expect_s3_class(x, "ggplot")
invisible(ggplot2::ggplot_build(x))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.