I have a data set that has column containing year, and a column containing the ordinal (yday) day for each year. I would like to convert this information into a calendar date, so I can better filter the data set. The data looks like this, but is from 1980-2016 and has an entry for each day of the year:
year yday temp
1980 1 0.5
1980 2 -5.0
1980 3 -3.5
1980 4 1.0
1980 5 -1.0
temps<-structure(list(year = c(1980L, 1980L, 1980L, 1980L, 1980L), yday = 1:5,
temp = c(0.5, -5, -3.5, 1, -1)), row.names = c(NA, -5L), class = c("tbl_df",
"tbl", "data.frame"), .Names = c("year", "yday", "temp"))
I tried the following code, but could not get the correct calendar date: Convert day of year to date