plotflow (version 0.2.1)

cushion: Determine Max Value + n Extra

Description

Determine max value of a vector plus an additional proportion.

Usage

cushion(x, pad = 0.05)

Arguments

x

A vector.

pad

A proportion extra to add.

Value

Returns the max value of a vector + n extra.

Examples

Run this code
# NOT RUN {
cushion(as.factor(mtcars$cyl))
cushion(mtcars$cyl)
cushion(mtcars$cyl, .5)

# }
# NOT RUN {
ggplot(reorder_by(cyl, ~-cyl , mtcars, length), aes(x=as.factor(cyl))) +
    geom_bar()  +
    theme_apa() +
    y0(cushion(as.factor(mtcars$cyl))) +
    xlab("Cylinders") +
    ylab("Total")
# }

Run the code above in your browser using DataCamp Workspace