Skip to content

An R package of Poisson Consulting's plotting functions

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

poissonconsulting/poisplot

Repository files navigation

Lifecycle: stable R build status Codecov test coverage License: MIT

poisplot

poisplot is an R package of a few utility functions to help with creating ggplot objects for Poisson’s projects.

Demonstration

People often find it easiest to conceptualize an effect size in terms of the percent change. However, negative percent change (which cannot be less than 100%) does not scale linearly in the same way as positive percent change (which is unlimited). This results in positive changes appearing much larger than equivalent negative changes in a standard plot.

library(poisplot)
library(ggplot2)
library(scales)

data <- data.frame(y = c(-3 / 4, -2 / 3, -1 / 2, 0, 1, 2, 3))
data$x <- 1:nrow(data)

gp <- ggplot(data, aes(x = x, y = y)) +
  geom_hline(yintercept = 0, linetype = "dotted") +
  geom_line() +
  geom_point()

gp + scale_y_continuous(labels = percent)

The nfold_trans() function ensures that negative percent changes scale in the same way as positive percent changes.

gp + scale_y_continuous(labels = percent, trans = nfold_trans(), breaks = data$y)

The poisplot also makes the Poisson plot theme available.

gp + scale_y_nfold(labels = percent) +
  theme_Poisson()

Installation

To install from GitHub

install.packages("devtools")
devtools::install_github("poissonconsulting/poisplot")

Contribution

Please report any issues.

Pull requests are always welcome.

Code of Conduct

Please note that the poisplot project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

About

An R package of Poisson Consulting's plotting functions

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages