Practice Problem Set 5B: Factors
Run the following code to load the data. View the codebook for the data here.
Create a graph like we did in Lecture 2 of the relationship between temperature and total bike rentals. What is odd about this graph?
Re-code the
season,yr,mnth,holiday,weekday,workingday, andweather-sitvariables.Change the season variable into a factor variable. What are the levels of the variable? Reorder the variable so that we have Summer, Fall, Winter, Spring.
Recreate the graph from Q2 with the new reordered variable.
Create a bar chart for the
weathersitvariable.Lump together the least frequent two levels and recreate the graph from Q6.