One Dataset Three Ways

learn r with me Mar 20, 2023
The text One Dataset Three ways with images of a population pyramid, a heatmap, and a slope graph along with the Schilling Data Studio logo.

I collect data about my reading in a Google Sheet each year, and then I use my favorite tool R to visualize it! Making data visualization in R on a fun dataset is a great way to learn new skills and practice - you don't have to find a big complex dataset on the internet, just pick something you're interested or collect data about yourself.

This year, one way I looked at my reading data was to compare my reading by genre in 2021 to 2022. I found that in 2022, I read more General Fiction, Mystery, and Romance and less Nonfiction, Fantasy, and Memoir than 2021.⁣ I used R to create three different visualizations and explore this data.

Slope Chart

A slope chart is usually used to compare data at two different points in time or across two different groups. It is helpful for showing relative increase or decrease. ⁣

I really like slope charts because they can show a lot in a single graphic! ⁣We can see the change from 2021 to 2022, the value for each genre in each year, and a comparison between the genres. ⁣

One thing to watch out for with slope charts is the amount of overlap in the lines – if there is too much overlap, it's difficult to see the trend or message.⁣ This graph is starting to get towards that too much overlap, especially in the lower percentages.

Heat Map

Heat maps can be used to visualize the relationship between variables. They can also be used to highlight the important data points and examine trends. ⁣

Here, it's easy to see where the percentages differed between the years in each genre, especially when there's a large difference and the color gets darker or lighter.⁣

Population Pyramid

This time, I used a population pyramid format to compare the percentage of total books I read in each genre per year. ⁣Population pyramids show the number or percentage in each category between two groups or points in time. ⁣

They make it easy to see the distribution across categories in each group or time point. Population pyramids also allow for comparison between the groups or times points by category.⁣ Here, we can easily see which genres I read the most of each year. We can also see how the shape of my reading by genre changed between the two years. ⁣

So, how do you know what type of chart to use?⁣

It depends on your data, your message, and your audience. ⁣

Certain chart types will not work for certain types of data or certain messages. For example, bar charts are good for comparisons between categories and line charts are good for showing data over time.⁣

When thinking about your audience, consider the following questions: How easily will they be able to consume the data in different charts? How comfortable are they with data and with looking at charts?

These graphs were all made in R, which makes it easy to test out different visualizations on the same data!⁣⁣ I was able to put all my data processing along with the code for these visualizations all in one R script, making it easy to do this again with new data.

Plus, I can quickly switch out the graph types with the same data, and in R I can completely customize each plot!

Do you want to learn how to make data viz in R? All the visualizations I share are made in R, and I'm opening an online program to teach you how to use R for data viz. Check out Intro to R for Data Viz.

Stay connected with news and updates!

Join our mailing list to receive the latest news and updates from our team.
Don't worry, your information will not be shared.

We hate SPAM. We will never sell your information, for any reason.