How do I convert date to number of days, starting from the first day of the year.
How do I convert the following to the expected result below?
Dat
You can also use this solution to get the number of the days :
mydates <- as.Date(c("2007-06-22", "2004-02-13")) days <- mydates[1] - mydates[2] days <- as.numeric(days) [1] 1225