All Projects β†’ hrbrmstr β†’ Ggeconodist

hrbrmstr / Ggeconodist

Licence: other
πŸ“‰ Create Diminutive Distribution Charts

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Ggeconodist

Ggalt
🌎 Extra Coordinate Systems, Geoms, Statistical Transformations & Scales for 'ggplot2'
Stars: ✭ 561 (+958.49%)
Mutual labels:  ggplot2, rstats
Ggthemr
Themes for ggplot2.
Stars: ✭ 697 (+1215.09%)
Mutual labels:  ggplot2, rstats
Tidyexplain
πŸ€Ήβ€β™€ Animations of tidyverse verbs using R, the tidyverse, and gganimate
Stars: ✭ 558 (+952.83%)
Mutual labels:  ggplot2, rstats
Hexsticker
✨ Hexagon sticker in R
Stars: ✭ 464 (+775.47%)
Mutual labels:  ggplot2, rstats
Ggrepel
πŸ“ Repel overlapping text labels away from each other.
Stars: ✭ 853 (+1509.43%)
Mutual labels:  ggplot2, rstats
Moderndive book
Statistical Inference via Data Science: A ModernDive into R and the Tidyverse
Stars: ✭ 527 (+894.34%)
Mutual labels:  ggplot2, rstats
Ggforce
Accelerating ggplot2
Stars: ✭ 640 (+1107.55%)
Mutual labels:  ggplot2, rstats
Ggextra
πŸ“Š Add marginal histograms to ggplot2, and more ggplot2 enhancements
Stars: ✭ 299 (+464.15%)
Mutual labels:  ggplot2, rstats
Geowaffle
Combining waffle plot with geofacet
Stars: ✭ 26 (-50.94%)
Mutual labels:  ggplot2, rstats
Tidymv
Tidy Model Visualisation for Generalised Additive Models
Stars: ✭ 25 (-52.83%)
Mutual labels:  ggplot2, rstats
Tidytuesday
πŸ“Š My contributions to the #TidyTuesday challenge
Stars: ✭ 410 (+673.58%)
Mutual labels:  ggplot2, rstats
Ggplot Courses
πŸ‘¨β€πŸ« ggplot2 Teaching Material
Stars: ✭ 40 (-24.53%)
Mutual labels:  ggplot2, rstats
Ggsignif
Easily add significance brackets to your ggplots
Stars: ✭ 322 (+507.55%)
Mutual labels:  ggplot2, rstats
Upsetr
An R implementation of the UpSet set visualization technique published by Lex, Gehlenborg, et al..
Stars: ✭ 531 (+901.89%)
Mutual labels:  ggplot2, rstats
Ggpage
Creates Page Layout Visualizations in R πŸ“„πŸ“„πŸ“„
Stars: ✭ 306 (+477.36%)
Mutual labels:  ggplot2, rstats
Waffle
🍁 Make waffle (square pie) charts in R
Stars: ✭ 614 (+1058.49%)
Mutual labels:  ggplot2, rstats
Ggpointdensity
πŸ“ˆ πŸ“Š Introduces geom_pointdensity(): A Cross Between a Scatter Plot and a 2D Density Plot.
Stars: ✭ 286 (+439.62%)
Mutual labels:  ggplot2, rstats
Ggpomological
πŸ‘ Pomological plot theme for ggplot2
Stars: ✭ 293 (+452.83%)
Mutual labels:  ggplot2, rstats
Hrbrthemes
πŸ” Opinionated, typographic-centric ggplot2 themes and theme components
Stars: ✭ 899 (+1596.23%)
Mutual labels:  ggplot2, rstats
Ggcats
The geom you always wished for adding cats to ggplot2
Stars: ✭ 34 (-35.85%)
Mutual labels:  ggplot2, rstats

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Signed by Signed commit % Linux build Status Coverage Status Minimal R Version License

ggeconodist

Create Diminutive Distribution Charts

Description

β€˜The Economist’ has a unique boxplot aesthetic f or communicating distrribution characteristics. Tools are provided to create similar charts in β€˜ggplot2’.

Inspired by: https://www.economist.com/united-states/2019/06/29/will-transparent-pricing-make-americas-health-care-cheaper

What’s Inside The Tin

  • add_econodist_legend: Helper utility to get an econodist legend into a ggplot2 plot
  • econodist_legend_grob: Create a legend grob that can be used with econodist charts
  • geom_econodist: Econodist geom / stat
  • left_align: Helper to flush ggplot2 plot components to the left
  • mammogram_costs: Cost of a mammogram in various U.S. Citites (2016, USD)
  • theme_econodist: A more current Economist-style ggplot2 theme

The following functions are implemented:

Installation

install.packages("ggeconodist", repos = "https://cinc.rud.is")
# or
remotes::install_git("https://git.rud.is/hrbrmstr/ggeconodist.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/ggeconodist")
# or
remotes::install_gitlab("hrbrmstr/ggeconodist")
# or
remotes::install_bitbucket("hrbrmstr/ggeconodist")
# or
remotes::install_github("hrbrmstr/ggeconodist")

NOTE: To use the β€˜remotes’ install options you will need to have the {remotes} package installed.

Usage

library(ggeconodist)

# current version
packageVersion("ggeconodist")
## [1] '0.1.0'

The whole shebang

YOU WILL NEED to install these fonts to use the built-in theme. More on how to do that at some point.

ggplot(mammogram_costs, aes(x = city)) +
  geom_econodist(
    aes(ymin = tenth, median = median, ymax = ninetieth),
    stat = "identity", show.legend = TRUE
  ) +
  scale_y_continuous(expand = c(0,0), position = "right", limits = range(0, 800)) +
  coord_flip() +
  labs(
    x = NULL, y = NULL,
    title = "Mammoscams",
    subtitle = "United States, prices for a mammogram*\nBy metro area, 2016, $",
    caption = "*For three large insurance companies\nSource: Health Care Cost Institute"
  ) +
  theme_econodist() -> gg

grid.newpage()
left_align(gg, c("subtitle", "title", "caption")) %>% 
  add_econodist_legend(econodist_legend_grob(), below = "subtitle") %>% 
  grid.draw()
library(dplyr)
library(patchwork)
library(hrbrthemes)
library(gapminder)

p <- ggplot(mpg, aes(class, hwy)) + theme_ipsum_rc()

(p + geom_boxplot()) +
(p + geom_econodist(width = 0.25)) +
  plot_layout(ncol = 1)

(p + geom_boxplot() + coord_flip()) +
(p + geom_econodist(tenth_col = ft_cols$blue, ninetieth_col = ft_cols$red) +
   coord_flip()) +
  plot_layout(ncol = 1)

(p + geom_boxplot(aes(fill = factor(drv)))) +
  (p + geom_econodist(aes(fill = factor(drv)))) +
  plot_layout(ncol = 1)
gapminder %>%
  filter(year %in% c(1952, 1962, 1972, 1982, 1992, 2002)) %>%
  filter(continent != "Oceania") %>%
  ggplot(aes(x = factor(year), y = lifeExp, fill = continent)) +
  geom_econodist(
    median_point_size = 1.2,
    tenth_col = "#b07aa1",
    ninetieth_col = "#591a4f",
    show.legend = FALSE
  ) +
  ggthemes::scale_fill_tableau(name = NULL) +
  coord_flip() +
  labs(
    x = "Year", title = "Life Expectancy", y = NULL,
    caption = "Example borrowed from @cmdline_tips"
  ) +
  facet_wrap(~continent, nrow = 4) +
  theme_ipsum_rc() -> gmgg

grid.newpage()
gmgg %>% 
  add_econodist_legend(
    econodist_legend_grob(
      tenth_col = "#b07aa1",
      ninetieth_col = "#591a4f",
    ), 
    below = "axis-b-1-4", 
    just = "right"
  ) %>% 
  grid.draw()

ggeconodist Metrics

Lang # Files (%) LoC (%) Blank lines (%) # Lines (%)
R 10 0.91 398 0.85 76 0.72 137 0.77
Rmd 1 0.09 69 0.15 30 0.28 40 0.23

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].