Practice Problem Set 5B: Factors

  1. Run the following code to load the data. View the codebook for the data here.

  2. Create a graph like we did in Lecture 2 of the relationship between temperature and total bike rentals. What is odd about this graph?

  3. Re-code the season, yr, mnth, holiday, weekday, workingday, and weather-sit variables.

  4. 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.

  5. Recreate the graph from Q2 with the new reordered variable.

  6. Create a bar chart for the weathersit variable.

  7. Lump together the least frequent two levels and recreate the graph from Q6.