我想在R中获得当月的开始日期.现在我使用以下内容
currentDate<-Sys.Date() #for getting current system date eg:2012-11-06
formatDate<-format(currentDate,"%Y-%m") #it return 2012-11
startDate<-as.Date(paste(formatDate,"-01",sep="")) #it return 2012-11-01
Run Code Online (Sandbox Code Playgroud)
有没有简单的方法来做到这一点?