All Projects β†’ thomas-neitmann β†’ Ggcharts

thomas-neitmann / Ggcharts

Licence: other
Get You to Your Desired Plot Faster

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Ggcharts

Waffle
🍁 Make waffle (square pie) charts in R
Stars: ✭ 614 (+199.51%)
Mutual labels:  ggplot2, data-visualization
Esquisse
RStudio add-in to make plots with ggplot2
Stars: ✭ 1,097 (+435.12%)
Mutual labels:  ggplot2, data-visualization
Ggthemr
Themes for ggplot2.
Stars: ✭ 697 (+240%)
Mutual labels:  ggplot2, data-visualization
Moderndive book
Statistical Inference via Data Science: A ModernDive into R and the Tidyverse
Stars: ✭ 527 (+157.07%)
Mutual labels:  ggplot2, data-visualization
Plotly
An interactive graphing library for R
Stars: ✭ 2,096 (+922.44%)
Mutual labels:  ggplot2, data-visualization
Clip
Create charts from the command line
Stars: ✭ 5,111 (+2393.17%)
Mutual labels:  data-visualization, plots
Soccergraphr
Soccer Analytics in R using OPTA data
Stars: ✭ 42 (-79.51%)
Mutual labels:  ggplot2, data-visualization
Ggpage
Creates Page Layout Visualizations in R πŸ“„πŸ“„πŸ“„
Stars: ✭ 306 (+49.27%)
Mutual labels:  ggplot2, data-visualization
Gganimate
A Grammar of Animated Graphics
Stars: ✭ 1,744 (+750.73%)
Mutual labels:  ggplot2, data-visualization
Kravis
A {K}otlin g{ra}mmar for data {vis}ualization
Stars: ✭ 134 (-34.63%)
Mutual labels:  ggplot2, data-visualization
Awesome Ggplot2
A curated list of awesome ggplot2 tutorials, packages etc.
Stars: ✭ 399 (+94.63%)
Mutual labels:  ggplot2, data-visualization
Matplotplusplus
Matplot++: A C++ Graphics Library for Data Visualization πŸ“ŠπŸ—Ύ
Stars: ✭ 2,433 (+1086.83%)
Mutual labels:  data-visualization, plots
Ggsci
πŸ¦„ Scientific journal and sci-fi themed color palettes for ggplot2
Stars: ✭ 381 (+85.85%)
Mutual labels:  ggplot2, data-visualization
Volbx
Graphical tool for data manipulation written in C++/Qt
Stars: ✭ 187 (-8.78%)
Mutual labels:  data-visualization, plots
Swiftplot
Swift library for Data Visualization πŸ“Š
Stars: ✭ 319 (+55.61%)
Mutual labels:  data-visualization, plots
Hrbrthemes
πŸ” Opinionated, typographic-centric ggplot2 themes and theme components
Stars: ✭ 899 (+338.54%)
Mutual labels:  ggplot2, data-visualization
Ggplotnim
A port of ggplot2 for Nim
Stars: ✭ 95 (-53.66%)
Mutual labels:  ggplot2, data-visualization
Slopegraph
Edward Tufte-Inspired Slopegraphs
Stars: ✭ 166 (-19.02%)
Mutual labels:  ggplot2, data-visualization
Data Science Toolkit
Collection of stats, modeling, and data science tools in Python and R.
Stars: ✭ 169 (-17.56%)
Mutual labels:  ggplot2, data-visualization
Gradio
Create UIs for your machine learning model in Python in 3 minutes
Stars: ✭ 4,358 (+2025.85%)
Mutual labels:  data-visualization

ggcharts

R build status CRAN Version Total Downloads Lifecycle Status

Overview

{ggcharts} provides a high-level {ggplot2} interface for creating common charts. Its aim is both simple and ambitious: to get you from your data visualization idea to an actual plot faster. How so? By taking care of a lot of data preprocessing, obscure {ggplot2} details and plot styling for you. The resulting plots are ggplot objects and can be further customized using any {ggplot2} function.

Installation

The package is available from CRAN.

install.packages("ggcharts")

Alternatively, you can install the latest development version from GitHub.

if (!"remotes" %in% installed.packages()) {
  install.packages("remotes")
}
remotes::install_github("thomas-neitmann/ggcharts", upgrade = "never")

If you get an error when trying to install from GitHub, run this code and then try to install once again.

Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS = "true")

If the installation still fails please open an issue.

Why ggcharts?

Thanks to {ggplot2} you can create beautiful plots in R. However, it can often take quite a bit of effort to get from a data visualization idea to an actual plot. As an example, let’s say you want to create a faceted bar chart displaying the top 10 within each facet ordered from highest to lowest. What sounds simple is actually pretty hard to achieve. Have a look:

library(dplyr)
library(ggplot2)
library(ggcharts)
data("biomedicalrevenue")

biomedicalrevenue %>%
  filter(year %in% c(2012, 2015, 2018)) %>%
  group_by(year) %>%
  top_n(10, revenue) %>%
  ungroup() %>%
  mutate(company = tidytext::reorder_within(company, revenue, year)) %>%
  ggplot(aes(company, revenue)) +
  geom_col() +
  coord_flip() +
  tidytext::scale_x_reordered() +
  facet_wrap(vars(year), scales = "free_y")

That’s a lot of code! And you likely never heard of some of the functions involved. With {ggcharts} you can create the same plot (actually an even better looking one) in almost a single line of code.

biomedicalrevenue %>%
  filter(year %in% c(2012, 2015, 2018)) %>%
  bar_chart(x = company, y = revenue, facet = year, top_n = 10)

Gallery

Charts

data("revenue_wide")
line_chart(data = revenue_wide, x = year, y = Roche:Bayer) +
  labs(x = "Year", y = "Revenue (Billion USD)")
biomedicalrevenue %>%
  filter(year == 2018) %>%
  lollipop_chart(x = company, y = revenue, threshold = 30) +
  labs(
    x = NULL,
    y = "Revenue",
    title = "Biomedical Companies with Revenue > $30Bn."
  ) +
  scale_y_continuous(
    labels = function(x) paste0("$", x, "Bn."),
    expand = expansion(mult = c(0, .05))
  )
data("popeurope")
dumbbell_chart(
  data = popeurope,
  x = country,
  y1 = pop1952,
  y2 = pop2007,
  top_n = 10,
  point_colors = c("lightgray", "#494F5C")
) +
  labs(
    x = NULL,
    y = "Population",
    title = "Europe's Largest Countries by Population in 2007"
  ) +
  scale_y_continuous(
    limits = c(0, NA),
    labels = function(x) paste(x, "Mn.")
  )
data(mtcars)
mtcars_z <- dplyr::transmute(
  .data = mtcars,
  model = row.names(mtcars),
  hpz = scale(hp)
)

diverging_bar_chart(data = mtcars_z, x = model, y = hpz)
diverging_lollipop_chart(
  data = mtcars_z,
  x = model,
  y = hpz,
  lollipop_colors = c("#006400", "#b32134"),
  text_color = c("#006400", "#b32134")
)
data("popch")
pyramid_chart(data = popch, x = age, y = pop, group = sex)

Themes

ggcharts_set_theme("theme_hermit")
bar_chart(data = diamonds, x = cut)
ggcharts_set_theme("theme_ng")
bar_chart(data = diamonds, x = cut)
ggcharts_set_theme("theme_nightblue")
bar_chart(data = diamonds, x = cut)
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].