plotflow (version 0.2.1)

label_rename_margin: Rename the Margins of ggplot2 facet_grid

Description

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

Usage

label_rename_margin(newname = "Total")

Arguments

newname

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

Examples

Run this code
# NOT RUN {
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"))
# }

Run the code above in your browser using DataCamp Workspace