label_rename_margin: Rename the Margins of ggplot2 facet_grid

Description Usage Arguments Examples

Description

Convert the default (all) when setting ggplot2's facet_grid to margins = TRUE.

Usage

1
label_rename_margin(newname = "Total")

Arguments

newname

The new strip.text name to overwrite (all).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mtcars2 <- mtcars
mtcars2$gear <- factor(mtcars2$gear)
ggplot(mtcars2, aes(cyl)) +
    geom_point(stat="bin", size = 2, binwidth = 2,
        aes(shape = gear), position = "stack") +
    facet_grid(carb ~ gear, margins = TRUE,
        labeller=label_rename_margin("Total"))

ggplot(mtcars2, aes(cyl)) +
    geom_point(stat="bin", size = 2, binwidth = 2,
        aes(shape = gear), position = "stack") +
    facet_grid(carb ~ gear, margins = "gear",
        labeller=label_rename_margin("Total"))

trinker/plotflow documentation built on May 31, 2019, 9:42 p.m.