Find day of year with the lubridate package in R The correct function is yday, as in lubridate::yday(Sys.time())