1
$\begingroup$

I have data set with a Date column, now i am trying to calculate duration in days from today to dates in date column with a new column named duration. I tried

    duration <- today() - sales$Date

But is giving errors What is the best way to it?

$\endgroup$
  • $\begingroup$ Check the format of dates in the sales$Date column of your data. It must be in the same format of dates returned by today(). $\endgroup$ – naive Sep 12 '18 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.