'Adding a Date column that corresponds to the value in the day of the week column in R

How do I add a Date column that corresponds to the value in the day of the week column in R?

For example, if the WeekStarting value is “2016-01-03”, then the value in the Date column for the Monday that comes after “2016-01-03” should have a value of “2016-01-04”.

https://i.stack.imgur.com/YErsJ.png

r


Solution 1:[1]

Try first just adding a column that has the consecutive dates

seq(as.Date("2016/1/3"), as.Date("2016/1/17"), "days")

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1