Examples for 'ggthemes::bank_slopes'


Bank Slopes to 45 degrees

Aliases: bank_slopes

Keywords:

### ** Examples

library("ggplot2")
Want to understand how all the pieces fit together? Read R for Data
Science: https://r4ds.had.co.nz/
# Use the classic sunspot data from Cleveland's original paper
x <- seq_along(sunspot.year)
y <- as.numeric(sunspot.year)
# Without banking
m <- ggplot(data.frame(x = x, y = y), aes(x = x, y = y)) +
   geom_line()
m
plot of chunk example-ggthemes-bank_slopes-1
## Using the default method, Median Absolute Slope
ratio <- bank_slopes(x, y)
m + coord_fixed(ratio = ratio)
plot of chunk example-ggthemes-bank_slopes-1
## Using culling
## Average Absolute Slope
bank_slopes(x, y, method = "as")
[1] 0.03682336

[Package ggthemes version 4.2.4 Index]