Skip to content

Instantly share code, notes, and snippets.

@DATAUNIRIO
Created June 11, 2022 17:57
Show Gist options
  • Save DATAUNIRIO/f8b69d3f52e95ac89c29796d84606bf6 to your computer and use it in GitHub Desktop.
Save DATAUNIRIO/f8b69d3f52e95ac89c29796d84606bf6 to your computer and use it in GitHub Desktop.
# remotes::install_github("thomas-neitmann/ggcharts", upgrade = "never")
library(dplyr)
library(ggcharts)
biomedicalrevenue %>%
filter(year %in% c(2012, 2015, 2018)) %>%
bar_chart(x = company, y = revenue, facet = year, top_n = 10)
biomedicalrevenue %>% filter(year == 2018) %>%
lollipop_chart(x = company, y = revenue, threshold = 30)
dumbbell_chart(
data = popeurope,
x = country,
y1 = pop1952,
y2 = pop2007,
top_n = 10,
point_colors = c("lightgray", "#494F5C")
)
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"))
pyramid_chart(data = popch, x = age, y = pop, group = sex)
#ggcharts_set_theme("theme_hermit")
bar_chart(data = diamonds, x = cut)
biomedicalrevenue %>%
filter(year %in% c(2012, 2014, 2016, 2018)) %>%
bar_chart(company,revenue,facet = year,top_n = 12,highlight = "Bayer")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment