Skip to content

cran/ggerror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ggerror ggerror hex logo

ORCID

ggerror simplifies ggplot2's error geoms and introduces asymetric error bars and customization.

Instead of wiring ymin / ymax or xmin / xmax by hand, you supply error (or error_neg + error_pos) and ggerror will do the rest for you. It can be as simple as providing a single error argument, yet offer full customization options for per-side styling.

Installation

pak::pak('iamyannc/ggerror')

library(ggplot2)
library(ggerror)

p <- ggplot(mtcars, aes(mpg, rownames(mtcars))) +
  geom_point()

# Symmetric error bars, using default geom errorbar
p + geom_error(aes(error = drat))

# Asymmetric error bars, using geom_error_pointrange and per-side styling
p + geom_error_pointrange(aes(error_neg = drat / 2, error_pos = drat, linetype_neg = "dashed"))

# One-sided error bars, using the error_geom argument
p + geom_error(error_geom = "linerange", aes(error_neg = 0, error_pos = drat), width_neg = 0)

Symmetric error bars

ggerror example geoms - symmetric

Asymmetric error bars

ggerror example geoms - asymmetric

For detailed examples of symmetric, asymmetric, one-sided, and per-side styling, see vignette("ggerror").

Supported geoms

ggplot2 Base geom_error(error_geom = ...) Specific Wrapper
geom_errorbar "errorbar" (default) geom_error()
geom_linerange "linerange" geom_error_linerange()
geom_pointrange "pointrange" geom_error_pointrange()
geom_crossbar "crossbar" geom_error_crossbar()

Disclaimer

This package was developed with the assistance of AI tools. All code has been reviewed by the author, who remains responsible for its quality. Ideas for new geoms are welcome.

About

❗ This is a read-only mirror of the CRAN R package repository. ggerror — Extended Error Geoms for 'ggplot2'. Homepage: https://github.com/iamYannC/ggerror Report bugs for this package: https://github.com/iamYannC/ggerror/issues

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors