2. DATES IN R
• Date objects
• Using as.Date – converts a string into integer
• Number of days from 01/01/1970
• Using your own epoch in as.Date
• Sequence function
• Date + Time objects
• as.POSIXct – suitable for data frames
• as.POSIXlt – human readable
• Uses machines time zone
• Time zone may be specified
3. DATES IN R
• Operations of date objects
• Weekdays, months, quarters
• diff
• difftime
4. LUBRIDATE
• Special functions
• ymd, mdy, dmy
• hms, hm
• ymd_hm
• seconds, months, years
• Arithmetic operations
• Explicitly specify units
5. CATEGORICAL DATA (FACTORS)
• Factors – data type for handling categorical data
• Labels
• Levels
• Creation
• Using factor function
• Label and level are determined alphabetically
• Levels can be user-specified
• Changing the levels
• Reordering the levels
• Reducing the levels