Convert date field to Quarter in R

后端 未结 1 1102
抹茶落季
抹茶落季 2020-12-21 18:43

I have data frame which has the date column in format 08/21/2000(m/d/Y).

Now I want to add new column which display the date in Quarter

相关标签:
1条回答
  • 2020-12-21 19:12

    The zoo library has created a set of functions to handle year-quarter vectors:

    library(zoo)
    mydf$var9=as.yearqtr(as.Date( mydf$Order.Date, "%m/%d/%Y" ).
    
    0 讨论(0)
提交回复
热议问题