2024-05-29
I’m excited to introduce you to an incredibly valuable resource for anyone working with data visualisation in R: the Data to Viz website.
Data to Viz is a comprehensive guide designed to help users make informed decisions about which type of visualisation best suits their data. The website offers a structured and intuitive approach to choosing the most effective chart for your data story.
It has a user-friendly navigation, that aims to guide you through a decision tree to simplify the selection process based on the nature of your data and the story you wish to tell.
Includes support for popular programming environments such as R, Python and JavaScript.
It offers best practices for data visualisation, highlights common pitfalls, and provides aesthetic tips to enhance the readability and attractiveness of your charts. This makes it an excellent educational resource for both beginners and seasoned professionals aiming to improve their data storytelling skills.
Data going to be using is the Starwars dataset available through dplyr and originally from the Star Wars API (https://swapi.py4e.com/).
Objective: Compare the number of characters by species. https://r-graph-gallery.com/barplot
How do I re-order these -
Use method 1 from reorder instructions & remove NAs
Objective: Compare the distribution of heights across different species. https://r-graph-gallery.com/boxplot
Objective: Visualise the distribution of character ages (assuming ages were provided). https://r-graph-gallery.com/density-plot
library(dplyr)
library(ggplot2)
starwars %>%
ggplot(aes(x=height))+
geom_density(fill="blue",alpha=0.7)
Adding theme discussed on page