I have some date that I need to convert into Julian days. This is the data I have
date <- c("21-Jul", "14-Jul", "08-Jul", "08-Jul","16-Jul")
class(date)
[1] "character"
I want to convert date
into julian days. So for the above dates, the Julian days will be:
date
202,195,189,189,197
I found a function as.POSIXlt
that converts date into Julian day. For e.g.
tmp <- as.POSIXlt("16Jun10", format = "%d%b%y")
tmp$yday
# [1] 166
But this needs date in a particular order including year which I do not have. Is there any way to convert my dates which are characters and do not have year in it into Julian?
Also, this year is not a leap year.
Julian days imply the day of the year so 1st Jan is 1, 2nd Jan is 2 and so on....