I have a data frame like below
Un_ID Type Child ID Name DOB Hire_date Tenure
1 AMF 23 ASD,ghu 31-12-2016 14-01-1996 2004
2 GHK 45 dgu,khl 2/6/2010 25-05-1989 1993
3 FGT 65 hhm,mjh 11/10/2016 19-12-1990 1998
4 MHU 76 aaa,scg 11/7/2016 19-10-1993 1998
i am calculating difference between Hire date to today but i am getting answer in years (2004) and i want like 15 Years ,20 Years
trying like below
df$Tenure <- round(as.numeric(difftime(Sys.Date(),df$Hire_date,units = 'weeks')/52.25),0)
also i want to mutate a new column in data frame as T/F in 1,0 to check if Check if hire_date is > of DOB + 20 but getting error
Error in df$DOB + 17 : non-numeric argument to binary operator
df$Hire_check <- df$Hire_date>df$DOB+17