I have a data set dat
with a year
and a week
variable (both integers). I want to combine them into a date
POSIXct
variable in R
of the format W-YYYY.
However, I get NA values when I use the as.POSIXct
function.
My code is below:
as.POSIXct(paste(dat$week, dat$year), format="%V-%Y")