How can I create a vector containing the days of the week?

r

Solution

There you go, the vector of weekdays "Monday", ..., "Sunday":

days.of.week <- weekdays(x=as.Date(seq(7), origin="1950-01-01"))

Problem

I need a vector containing the days of the week very often, but I always type it out: ``` days.of.week <- c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday") ``` This is pretty easy because it's short, but there's always the possibility of typos. Is there a way to create a vector containing the days of the week programmatically?

Original source