Читать книгу The Big R-Book - Philippe J. S. De Brouwer - Страница 52
Dates
ОглавлениеWorking with dates is a complex subject. We explain the essence of the issues in Section 17.6 “Dates with lubridate” on page 407. For now, it is sufficient to know that dates are one of the base types of R.
date
# The function as.Data coerces its argument to a date d <- as.Date(c("1852-05-12", "1914-11-5", "2015-05-01")) # Dates will work as expected d_recent <- subset(d, d > as.Date("2005-01-01")) print(d_recent) ## [1] "2015-05-01"
as.Date()
subset()