September 2017
Beginner to intermediate
560 pages
25h 18m
English
Read the data from the file and create factors. We also attach the data to save on keystrokes as follows. Download the GGally and ggplot2 package, if you have not already done so:
> library(ggplot2) > library(GGally) > 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")) > bike$windspeed.fac <- cut(bike$windspeed, breaks=3, labels=c("Low", "Medium", "High")) > bike$weekday <- factor(bike$weekday, levels = c(0:6), labels = c("Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat")) > attach(bike)
Read now
Unlock full access