colorFacet: Coloring and faceting helper for ggplot

Description Usage Arguments Value Examples

Description

This function takes a ggplot object and source data frame, d, and adds manual color and fill scale layers based on cby and clr and/or faceting based on fby and scales. The data frame, d, is passed for determining the levels of the factor cby in d. The cby and fby columns in d must be factors. Like coloring, faceting must be done by a single factor variable, not crossed factors.

Usage

1
colorFacet(g, d, cby, clr, fby, scales)

Arguments

g

a ggplot object.

d

a data frame.

cby

character, factor column in d.

clr

character, color vector. If NULL, no coloring by levels of cby occurs.

fby

character, factor column in d.

scales

character, passed to scales in ggplot2::facet_wrap.

Value

a ggplot object.

Examples

1
#not run

leonawicz/apputils documentation built on May 13, 2019, 1:38 a.m.