Convert a date vector into Julian day in R

后端 未结 5 1154
故里飘歌
故里飘歌 2020-11-30 11:03

I have a column of dates in the format: 16Jun10 and I would like to extract the Julian day. I have various years.

I have tried the functions julian and mdy.date an

5条回答
  •  悲哀的现实
    2020-11-30 11:50

    Similarly:

    require(lubridate)
    x = as.Date('2010-06-10')
    yday(x)
    
    [1] 161
    

    Also note, using lubridate:

    > dmy('16Jun10')
    [1] "2010-06-16 UTC"
    

提交回复
热议问题