How do I convert date to number of days in R

后端 未结 7 1698
囚心锁ツ
囚心锁ツ 2021-01-04 14:19

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         


        
7条回答
  •  日久生厌
    2021-01-04 14:57

    I guess this will help:

    Use as.Date()

    Example:

    one <- as.Date(c("02/01/2000", "01/01/2000"))
    

    number of days between 02/01/2000 and 02/01/2000:

    days <- one[1] - one[2]
    

提交回复
热议问题