Module 10

Two common data types that we often deal with in analyses are factors and dates:

  • Factors are used to represent categorical data, variables that have a fixed and known set of possible values (i.e. Gender: Female vs. Male; Months: Jan, Feb, …, Dec; Country: U.S., Germany, Japan).
  • Time series data have various date-time stamp information that can be very useful if we know how to properly work with them.

This module will teach you how to deal with these two data types.


Tutorials & Resources

Factors: Historically, factors were much easier to work with than characters. As a result, many of the functions in base R automatically convert characters to factors. This means that factors often crop up in places where they’re not actually helpful and you need to understand how to manipulate and work with them. Read and work through Chapter 15: Factors.

Dates: Real world data are often associated with dates and time; however, dealing with dates accurately can appear to be a complicated task due to the variety in formats and accounting for time-zone differences and leap years. Read and work through Chapter 16: Dates and times to learn how to manage date-time data.


Class Prep

Work through the exercises in each of the tutorials provided.

You can download class material here: