cushion: Determine Max Value + n Extra

Description Usage Arguments Value Note Examples

Description

Determine max value of a vector plus an additional proportion.

Usage

1
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.

Note

If x is a factor or character vector counts for each category are used as max(n).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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")

## End(Not run)

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