Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upsummary fails on a nanotime vector #24
Comments
|
Not nice. I guess we need a new S4 method? |
|
Yes, will look into it. |
|
After #25 it does it as R> options("width"=70)
R> summary(nanotime(1:10))
Min.
"1970-01-01T00:00:00.000000001+00:00"
1st Qu.
"1970-01-01T00:00:00.000000003+00:00"
Median
"1970-01-01T00:00:00.000000006+00:00"
Mean
"1970-01-01T00:00:00.000000005+00:00"
3rd Qu.
"1970-01-01T00:00:00.000000008+00:00"
Max.
"1970-01-01T00:00:00.000000010+00:00"
R> summary(nanotime(1:10)*3.6e6)
integer64
Min. 1st Qu. Median Mean 3rd Qu. Max.
3600000 10800000 21600000 19800000 28800000 36000000
R> |
|
What's going on above is that multiplying a > summary(nanotime(1:10*3.6e6))
Min. 1st Qu.
"1970-01-01T00:00:00.003600000+00:00" "1970-01-01T00:00:00.010800000+00:00"
Median Mean
"1970-01-01T00:00:00.021600000+00:00" "1970-01-01T00:00:00.019800000+00:00"
3rd Qu. Max.
"1970-01-01T00:00:00.028800000+00:00" "1970-01-01T00:00:00.036000000+00:00" I would say we should raise an error on multiplication and division of a > Sys.time()*3
Error in Ops.POSIXt(as.POSIXct(Sys.time()), 3) :
'*' not defined for "POSIXt" objectsWhat do you think? |
|
That's probably reasonable, and doable. |
|
Nicely done:
|
(Edited: You want three opening ticks followed by the language, here r. --Dirk)