|
seq.nanoduration <- function(from, to=NULL, by=NULL, length.out=NULL, along.with=NULL, ...) { |
|
## workaroud 'bit64' bug: |
|
if (is.null(by)) { |
|
if (is.null(length.out)) { |
|
length.out <- length(along.with) |
|
} |
|
by = (to - from) / (length.out - 1) |
|
} |
|
as.nanoduration(seq(as.integer64(from), to, as.integer64(by), length.out, along.with, ...)) |
|
} |
Hit by {nanotime} test suite:
|
expect_identical(seq(as.nanoduration("00:00:00"), to=as.nanoduration("00:00:09"), length.out=10), |
|
as.nanoduration(seq(0, by=1e9, length.out=10))) |
The version of {bit64} on its way to CRAN breaks this because seq.integer64 was overhauled to match seq.default behavior and error when receiving 4 non-NULL arguments:
seq(1, 2, by=1, length.out=2) # technically, no contradiction, but still errors
# Error in seq.default(1, 2, by = 1, length.out = 2) : too many arguments
## CRAN bit64
seq(bit64::as.integer64(1), 2, by=1, length.out=2)
# integer64
# [1] 1 2
## devel bit64
# Error in seq.integer64(...) : too many arguments
nanotime/R/nanoduration.R
Lines 676 to 685 in e2486c4
Hit by {nanotime} test suite:
nanotime/inst/tinytest/test_nanoduration.R
Lines 451 to 452 in e2486c4
The version of {bit64} on its way to CRAN breaks this because
seq.integer64was overhauled to matchseq.defaultbehavior and error when receiving 4 non-NULLarguments: