0

enter image description here

Hello,

i am trying to calculate the number of days since the complaint was registered. I wanted to calculate the number of days between "Date Notified" and today's date. i used the below command to get the result but it is showing me an error. Can anyone please help me !

Mergingopen%>%
  mutate(30 days since file opened = `Date Notified`,Sys.Date())
Rui Barradas
  • 70,273
  • 8
  • 34
  • 66
Prabesh Kc
  • 27
  • 7
  • Probably a duplicate: https://stackoverflow.com/q/12649641/1531971 –  Sep 13 '18 at 14:36
  • 1
    Possible duplicate of [calculating time difference in R](https://stackoverflow.com/questions/12649641/calculating-time-difference-in-r) – Rui Barradas Sep 13 '18 at 14:41

1 Answers1

2

Try

Mergingopen %>%
        mutate('30 days since file opened' = as.numeric(difftime(Sys.Date(),
                                                                 `Date Notified`,
                                                                 units = c("days"))))
nghauran
  • 6,648
  • 2
  • 20
  • 29