With lubridate
library(lubridate)
ymd("2010/03/17") - years(2)
More Related Contents:
- Convert date-time string to class Date
- Find the day of a week
- Converting year and month (“yyyy-mm” format) to a date?
- Changing date format in R
- as.Date with dates in format m/d/y in R
- Add a month to a Date [duplicate]
- Convert integer to class Date
- How to subtract/add days from/to a date?
- as.Date returning NA while converting from ‘ddmmmyyyy’
- R: How to handle times without dates?
- Collapse / concatenate / aggregate a column to a single comma separated string within each group
- How to prevent ifelse() from turning Date objects into numeric objects
- What is the difference between require() and library()?
- How to sort a character vector where elements contain letters and numbers in R?
- Add column which contains binned values of a numeric column
- Replace all 0 values to NA
- Scheduling R Script
- Calculate group mean, sum, or other summary stats. and assign column to original data
- Split date-time column into Date and time variables
- Generate a sequence of the last day of the month over two years
- What are the main differences between R data files?
- Finding All Positions for Multiple Elements in a Vector
- Get filename without extension in R
- ending “+” prompt in R
- R round to nearest .5 or .1
- Apply several summary functions (sum, mean, etc.) on several variables by group in one call
- Formatting a date in R without leading zeros
- R: xtable and dates
- Convert decimal day to HH:MM
- Round a POSIX date (POSIXct) with base R functionality