在r中創建學校日曆很酷,爲什麼noquote函數不能刪除矩陣中的引號?爲什麼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.....)
嘗試'print(y,quote = FALSE)'。 – A5C1D2H2I1M1N2O1R2T1
或者只是'noquote(y)'!!! –
格式(x,「%m%d」))您忘記的展位? – alap