collapse version 1.8.8
-
flm
andfFtest
are now internal generic with an added formula method e.g.flm(mpg ~ hp + carb, mtcars, weights = wt)
orfFtest(mpg ~ hp + carb | vs + am, mtcars, weights = wt)
in addition to the programming interface. Thanks to Grant McDermott for suggesting. -
Added method
as.data.frame.qsu
, to efficiently turn the default array outputs fromqsu()
into tidy data frames. -
Major improvements to
setv
andcopyv
, generalizing the scope of operations that can be performed to all common cases. This means that even simple base R operations such asX[v] <- R
can now be done significantly faster usingsetv(X, v, R)
. -
n
andqtab
can now be added tooptions("collapse_mask")
e.g.options(collapse_mask = c("manip", "helper", "n", "qtab"))
. This will export a functionn()
to get the (group) count infsummarise
andfmutate
(which can also always be done usingGRPN()
butn()
is more familiar to dplyr users), and will masktable()
withqtab()
, which is principally a fast drop-in replacement, but with some different further arguments. -
Added C-level helper function
all_funs
, which fetches all the functions called in an expression, similar tosetdiff(all.names(x), all.vars(x))
but better because it takes account of the syntax. For example letx = quote(sum(sum))
i.e. we are summing a column namedsum
. Thenall.names(x) = c("sum", "sum")
andall.vars(x) = "sum"
so that the difference ischaracter(0)
, whereasall_funs(x)
returns"sum"
. This function makes collapse smarter when parsing expressions infsummarise
andfmutate
and deciding which ones to vectorize.