compare_ggplots: Compare two ggplot objects

Description Usage Arguments Value Examples

View source: R/Compare_ggplots.R

Description

Compare two ggplot objects

Usage

1
compare_ggplots(plot1, plot2, useTempFiles = TRUE)

Arguments

plot1

First ggplot object to compare.

plot2

Second ggplot object to compare.

useTempFiles

Whether or not to use temporary files in the comparison. Using temp files is faster, but some may wish to compare purely in memory.

Value

A boolean scalar showing whether the two plots are visually identical or not.

Examples

1
2
3
4
5
6
7
plot1 <- ggplot2::qplot(mpg, wt, data = mtcars, colour = cyl)
plot2 <- ggplot2::qplot(mpg, wt, data = mtcars, colour = cyl)
plot3 <- ggplot2::qplot(mpg, wt, data = mtcars, colour = carb)
compare_ggplots(plot1, plot2)
compare_ggplots(plot1, plot2, useTempFiles = FALSE)
compare_ggplots(plot1, plot3)
compare_ggplots(plot1, plot3, useTempFiles = FALSE)

KO112/KO documentation built on Oct. 2, 2020, 9:21 a.m.