在 r 中创建校历很酷,为什么 noquote 函数无法删除矩阵中的引号?
start<-as.Date("2013-09-02")
x<-start+0:139
rows<-paste(1:20,"th","week",sep="")
cols<-c("mon","tue","wed","thu","fri","sat","sun")
y<-matrix(noquote(as.character(format(x,"%m%d"))),nrow=20,byrow=TRUE,dimnames=list(rows,cols))
y
mon tue wed thu fri sat sun
1thweek "0902" "0903" "0904" "0905" "0906" "0907" "0908"
2thweek "0909" "0910" "0911" "0912" "0913" "0914" "0915"
(omitted.....)
为什么我无法获得以下格式:
mon tue wed thu fri sat sun
1thweek 0902 0903 0904 0905 0906 0907 0908
(omitted.....)