# The scatter plot of the number of registered users (have membership) # vs. the number of casual (no membership) users per hour. # Notice the data looks linear along two different lines. plot(hour$registered, hour$casual) # Create a new data frame called workingdays that contains only those rows where # the value in the workingday column is 1 (weekdays that are not holidays). workingdays <- subset(hour,workingday == 1) # Display the new dataframe (notice the workingday column is all 1's) workingdays # Scatter plof the number of registered users vs. number of casual users for # only the rows we previously identified as working days (weekdays that are not holidays). # Notice the data on this plot is only linear in one direction. plot(workingdays$registered,workingdays$casual) # Create a new data frame called non_workingdays that contains only those rows where # the value in the workingday column is 0 (weekends or holidays). non_workingdays <- subset(hour,workingday == 0) # Display the new dataframe (notice the workingday column is all 0's) non_workingdays # Scatter plof the number of registered users vs. number of casual users for # only the rows we previously identified as non-working days (weekends and holidays). # Notice the data on this plot is only linear in one direction. plot(non_workingdays$registered,non_workingdays$casual) # Create a new data frame of only rows where the hour is between 7am and 7pm inclusive. daytime <- subset(hour, hr >= 7 & hr <= 19) # Plot a histogram of total counts during daytime (7am - 7pm) hours hist(daytime$cnt) # Compare the above histogram to the histogram of all counts. # Notice when all hours are included, there is a big spike of 0 or near 0 counts, # which probably corresponds to the middle of the night, when not many people are # borrowing bikes. hist(hour$cnt)