Date when datediff = x


#1

I have a column of individuals birth dates.

How would you calculate the date that a person will be X (e.g., 18 years old)?

data.frame(birthdate = seq.Date(from = as.Date("1985-01-21"), to = as.Date("2018-01-01"), by = "4 months"), date_18 = ifelse(XXX))


#2

ah lubridate::years(18) should do the trick.