identical_aes: Are aesthetic mapping specifications "identical"?

View source: R/mappings.R

identical_aesR Documentation

Are aesthetic mapping specifications "identical"?

Description

The ggplot2 package uses quosures to record aesthetic mappings. These record both the mapping described as well as the environment in which the mapping was described. As a result, it is difficult to compare mappings created by students in one environment to mappings created on the fly by graders in another environment. identical_aes facilitates comparison by ignoring the environments associated with an aesthetic mapping specification. If the two specifications contain identical expressions, e.g. x = displ, etc., identical_aes returns TRUE.

Usage

identical_aes(a1, a2)

Arguments

a1

The output of aes, perhaps extracted from a ggplot object.

a2

The output of aes, perhaps extracted from a ggplot object.

Value

TRUE or FALSE

See Also

Other functions for checking mappings: get_mappings(), ith_mappings_use(), ith_mappings(), uses_mappings()


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