Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to convert the date to something like DAY1, DAY2, DAY3, instead of normal Monday, Tuesday, Wednesday.

rbind(DWReport__04,DWReport__05,DWReport__06,
          DWReport__07,DWReport__08,DWReport__09,
          DWReport__10,DWReport__11,DWReport__12,
          DWReport__13) %>%
           mutate( DAY = day(as.Date(Date, "%d/%m/%Y")))

can anyone help with adjustment on the code ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
267 views
Welcome To Ask or Share your Answers For Others

1 Answer

I think you've done the hard bit already.

Where you have mutate( DAY = day(as.Date(Date, "%d/%m/%Y")))

I believe you could just use: mutate(DAY = paste0("DAY", day(as.Date(Date, "%d/%m/%Y"))))


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...