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

前端 未结 4 1976
时光取名叫无心
时光取名叫无心 2021-02-20 12:07

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\",          


        
4条回答
  •  [愿得一人]
    2021-02-20 12:22

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

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

提交回复
热议问题