Skip to content
Prev 314652 / 398502 Next

Can you help me please

HI,
If you want to extract the month as in the format you mentioned in the original post:
Month<-format(dat1[,1],format="%b")
?head(Month)
#[1] "Jan" "Jan" "Jan" "Jan" "Jan" "Jan"


library(ISOweek)
?Week<-date2ISOweek(dat1[,1])
Week1<-gsub(".*\\-(.*)\\-.*","\\1",Week)
?head(Week1)
#[1] "W01" "W01" "W01" "W01" "W01" "W02"
A.K.