This is probably a very basic question I have downloaded a Google trends file and the date range for each row is a week format similar to 2004-01-04 - 2004-01-10. This is basically Sun to Sat
Pseudo Code here where the Week is equal to the format above (2004-01-04 - 2004-01-10)
googledata <- googledata %>%
mutate(startdate = ymd(substr(Week, 1, 10)),
enddate = ymd(substr(Week, 14, 26)),
weekno = isoweek(startdate),
weekno2 = isoweek(enddate))
Sample Data
Week Vol
2004-01-04 - 2004-01-10 15
2004-01-11 - 2004-01-17 12
2004-01-18 - 2004-01-24 10
2004-01-25 - 2004-01-31 10
2004-02-01 - 2004-02-07 9
2004-02-08 - 2004-02-14 9
I have two questions
Is this a specific week type for example ISO.
Is it possible to convert it to a week number using lubridate
or some other function in R. The problem is using isoweek
and week
result in split weeks for the start and end date
I have a second data set i want to match up but it uses a different Week Number type, so i would like to convert them both to the Google type
Thank you for your help