Skip to content

Examples of data visualizations using R, and ggplot2 mostly

Notifications You must be signed in to change notification settings

ericdaat/dataviz-examples-in-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dataviz examples in R

Data visualization examples, using the R programming language and ggplot2 library, mostly.

The dataset used to draw the figures is about CO2 emissions of driving cars sold in France, and is publicly available here.

The figures are located in the figures folder, and the corresponding code in the figures.R file.

Example:

fig12

With the corresponding code:

fig12 <- df %>%
  filter(Marque %in% c("AUDI", "BMW", "MERCEDES", "VOLKSWAGEN")) %>%
  group_by(Année, Marque) %>%
  summarise(n=n()) %>%
  ggplot(aes(x=Année,
             y=n,
             fill=Marque)) +
    geom_stream() +
    barplot_theme +
    scale_fill_ipsum() +
    labs(title="Evolution of the number of cars by German manufacturers",
         subtitle="Mercedes growth happened in the early 2000s, VW later after 2010",
         x="Year",
         y="Number of cars",
         fill="Manufacturer")

About

Examples of data visualizations using R, and ggplot2 mostly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages