Rにおける日付データの丸め – trunc関数

Reference – https://twitter.com/R_Programming/status/621898286807433216
> now<-Sys.time()
> now
[1] "2015-07-17 13:53:25 JST"

> trunc(now,"month")
Error in match.arg(units) : 
   'arg' は “secs”, “mins”, “hours”, “days” の一つでなければなりません: 

> trunc(now,"days")
[1] "2015-07-17 JST"

> trunc(now,"hours")
[1] "2015-07-17 13:00:00 JST"

> trunc(now,"mins")
[1] "2015-07-17 13:53:00 JST"

> trunc(now,"secs")
[1] "2015-07-17 13:53:25 JST"