here is an alternative long and winded solution to the problem sticking on the julian function of chron package
test$year <- as.integer(as.character(test$date, "%Y")) test$month <- as.integer(as.character(test$date, "%m")) test$day <- as.integer(as.character(test$date, "%d")) test$hour <- as.integer(as.character(test$date, "%H")) test$jday <-julian(test$month,test$day,test$year,origin=c(month=1, day=0, year=test$year)) thank you all for helping me in sorting out the problem by the way I like very much this very compact solution test$doy <- as.POSIXlt(test$date)$yday+1 but on the other hand I'm still struggling to fully understand it, especially for what is concerning the part after $: so what is $yday for? if someone would be so kind to explain me this part I would be very grateful a newbie in R lesson learned max -- View this message in context: http://r.789695.n4.nabble.com/julian-day-form-POSIXt-object-tp3855885p3859187.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.