Creating charts that help visualize a possible causality

When presenting data, rather than merely present information, we usually want to present an explanation of some phenomenon. Visualizing hypothesized causality helps to communicate our ideas clearly.

Getting ready

If you have not already done so, download the book's files for this chapter and save the daily-bike-rentals.csv file in your R working directory. Read the data into R as follows:

> bike <- read.csv("daily-bike-rentals.csv")
> bike$season <- factor(bike$season, levels = c(1,2,3,4), labels = c("Spring", "Summer", "Fall", "Winter"))
> bike$weathersit <- factor(bike$weathersit, levels = c(1,2,3), labels = c("Clear", "Misty/cloudy", "Light snow"))
> attach(bike)

How to do it...

With the bike ...

Get R: Recipes for Analysis, Visualization and Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.