R provides several options for working with dates and times. Date objects represent dates as the number of days since January 1, 1970 and support operations like adding or subtracting days. Time objects like POSIXct and POSIXlt store both dates and times, with the ability to specify time zones. The lubridate package offers convenient functions for parsing date-time strings and performing arithmetic on date-time components. Factors are R's data type for categorical variables and allow specifying labels, levels, and changing or reordering levels to control how categorical data is displayed and analyzed.
Related topics: