Get weekdays in English in R

后端 未结 6 1378
[愿得一人]
[愿得一人] 2020-12-07 21:03

I am using R outside the US and I got everything working in English, but the result of weekdays() is still in Spanish:

Day <- seq(as.Date(\"2         


        
6条回答
  •  执念已碎
    2020-12-07 21:43

    From my answer here, you can get weekdays in English without messing with locales like this:

    c("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", 
      "Friday", "Saturday")[as.POSIXlt(Day)$wday + 1]
    

提交回复
热议问题