Skip to content

Commit 5314615

Browse files
committed
codecov
1 parent 46af094 commit 5314615

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

R/frollapply.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ simplifylist = function(x, fill, ansmask) {
1515
ans.ut = "double"
1616
} else if ("integer" %in% ans.ut) {
1717
if ("logical" %in% ans.ut)
18-
x[ansmask & all.t=="logical"] = lapply(x[ansmask & all.t=="logical"], as.logical) ## coerce logical to integer
18+
x[ansmask & all.t=="logical"] = lapply(x[ansmask & all.t=="logical"], as.integer) ## coerce logical to integer
1919
else
2020
internal_error("simplifylist aligning return types, at that place there should have been some logical types in the answer") # nocov
2121
ans.ut = "integer"
@@ -51,8 +51,6 @@ simplifylist = function(x, fill, ansmask) {
5151
return(rbindlist(x))
5252
if (equal.lengths(x)) ## same length lists: list(list(1:2, 1:2), list(2:3, 2:3))
5353
return(rbindlist(x))
54-
if (all(vapply_1i(unique(lengths(x)), function(x) length(unique(x)), use.names=FALSE) == 1L)) ## within each x column lengths the same, each could be DF: list(list(1, 2), list(1:2, 2:3))
55-
return(rbindlist(x))
5654
}
5755
## not simplified, return as is
5856
# not length stable

inst/tests/froll.Rraw

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,10 @@ test(6010.751, frollapply(FUN=median, adaptive=TRUE, list(1:3,2:4), list(c(2,0,2
17831783
test(6010.752, frollapply(FUN=median, adaptive=TRUE, 1:3, c(2,0,2), fill=99), c(99,NA_real_,2.5))
17841784
test(6010.753, frollapply(FUN=median, adaptive=TRUE, c(1L,2L,4L), c(2,0,2), fill=99L), c(99,NA_real_,3))
17851785
test(6010.754, frollapply(FUN=median, adaptive=TRUE, c(1L,2L,3L), c(2,0,2), fill=99), c(99,NA_real_,2.5))
1786+
test(6010.755, frollapply(1:2, 1, function(i) if (i==1L) 1L else FALSE), c(1L,0L))
1787+
test(6010.756, frollapply(1:3, 2, fill=9, function(i) if (i[1L]==1L) 1L else FALSE), c(9L,1L,0L)) ## matches fun answer
1788+
test(6010.757, frollapply(1:3, 2, fill=9L, function(i) if (i[1L]==1L) 1 else FALSE), c(9,1,0)) ## matches fun answer
1789+
test(6010.758, frollapply(1:3, 2, fill=0, function(i) TRUE), c(FALSE,TRUE,TRUE)) ## matches fun answer
17861790

17871791
#### mutlithreading throttle caveats from manual: copy, fixing .internal.selfref
17881792
use.fork = .Platform$OS.type!="windows" && getDTthreads()>1L

0 commit comments

Comments
 (0)