Closed ethanbsmith closed 2 years ago
> TTR::runSum(1:10, n=1, cumulative = T) [1] NA 3 6 10 15 21 28 36 45 55
expect runSum(x, n= 1, cumulative = T) to always match cumsum(x)
runSum(x, n= 1, cumulative = T)
cumsum(x)
> cumsum(1:10) [1] 1 3 6 10 15 21 28 36 45 55
`runSum(1:10, n= 1, cumulative = T) == cumsum(1:10)`
is.na(result) <- c(1:(n - 1 + NAs)) shoudl be: is.na(result) <- c(0:(n - 1 + NAs))
is.na(result) <- c(1:(n - 1 + NAs))
is.na(result) <- c(0:(n - 1 + NAs))
went to write a pr and see that this is fixed in dev with is.na(result) <- seq_len(n-1+NAs)
is.na(result) <- seq_len(n-1+NAs)
TY!
Note: this was fixed in 0fbb7bae9769e13f3f58f2f7ea363d448a8a97af
Description
Expected behavior
expect
runSum(x, n= 1, cumulative = T)
to always matchcumsum(x)
Minimal, reproducible example
FIx:
is.na(result) <- c(1:(n - 1 + NAs))
shoudl be:is.na(result) <- c(0:(n - 1 + NAs))