move_legend_to_empty_facet: Moves a ggplot legend to an empty facet if one exists

View source: R/utilities.R

move_legend_to_empty_facetR Documentation

Moves a ggplot legend to an empty facet if one exists

Description

Moves a ggplot legend to an empty facet if one exists

Usage

move_legend_to_empty_facet(g)

Arguments

g

A ggplot2::ggplot()

Details

If an empty facet does not exist, an error will be thrown If the input object g is not a ggplot2::ggplot() object nor a ggplot2::ggplot_gtable() object, the original object is returned.

Value

A ggplot2::ggplot() object


pbs-assess/gfiscamutils documentation built on Oct. 24, 2024, 1:37 p.m.