gradethis_equal.ggplot: Compare two 'ggplot's to check whether they are equal

View source: R/gradethis_equal.R

gradethis_equal.ggplotR Documentation

Compare two ggplots to check whether they are equal

Description

Compare two ggplots to check whether they are equal

Usage

## S3 method for class 'ggplot'
gradethis_equal(x, y, ...)

Arguments

x, y

Two ggplot objects to compare

...

Unused

Value

A logical value of length one, or an internal gradethis error.

See Also

gradethis::gradethis_equal() for the generic function.

Examples

library(ggplot2)
library(ggcheck)
library(gradethis)

cty_plot <- ggplot(mpg, aes(x = displ, y = cty)) + geom_point()
hwy_plot <- ggplot(mpg, aes(x = displ, y = cty)) + geom_point()

gradethis_equal(cty_plot, hwy_plot)
gradethis_equal(cty_plot, cty_plot)

rstudio-education/ggcheck documentation built on May 12, 2023, 11:33 a.m.