Lecture 9 - Strings and Dates
Strings and dates are common objects to work on in data processing. As soon as you read files or print reports, you need strings. When you work with real-world problems, you need dates very often.
R has facilities for both strings and dates. The basic package has already a solid set of string and dates operations, but has limitations. Some of the limitations with strings and dates have been improved through the tidyverse packages stringr and lubridate. However, in this course, we will be focusing on handling strings and dates using Base R.
Below is a list of functions and objects to be covered in this section.
- strings
paste(),paste0()- args:
sep
- args:
nchar()tolower(),toupper()strsplit()substr(),substring()sub(),gsub()
- dates and times
Date,POSIXct,POSIXltSys.Date(),Sys.time()as.Date()ISOdate()format()- abbr:
b,B,d,m,y,Y
- abbr:
julian()as.POSIXlt()seq()- args:
from,to,by,length.out
- args: