power_breaks: Axis Breaks for power transformations

Description Usage Arguments Details Value See Also Examples

View source: R/hello.R

Description

Return vector of breaks that span the lims range evenly _after_ transformation

Usage

1
power_breaks(lims, power, n_breaks = NULL)

Arguments

lims

The range for which breaks should be produced.

power

PARAM_DESCRIPTION

n_breaks

deprecated, does not influence the result. Stop using altogether.

Details

The breaks will be numbers that are powers of 2. The base of 2 was chosen for three reasons. Firstly, the resulting breaks are sufficiently dense (example: in the [1,100]-interval, 2^x produces 2, 4, 8, 16, 32 and 64, while 10^x only produces 1, 10 and 100, which is often rather sparse). Secondly, for x>1 the powers of 2 are all integers (in contrast to 1.2^x, etc.). And thirdly, 2^x are numbers familiar to many people, especially geeks and scientists.

Value

OUTPUT_DESCRIPTION

See Also

log_breaks

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
if(interactive()){
 ggplot(data=diamonds, aes(price))+
 geom_histogram(breaks=logseq(diamonds$price)) +
 coord_trans(x=power_trans(1/2)) +
 scale_x_continuous(breaks = function(lims) power_breaks(lims, 1/2))
 }

## End(Not run)

FelixTheStudent/ggpower documentation built on March 5, 2020, 8:37 p.m.