collapse version 1.7.6
-
Corrected a C-level bug in
gsplit
that could lead R to crash in some instances (gsplit
is used internally infsummarise
,fmutate
,BY
andcollap
to perform computations with base R (non-optimized) functions). -
Ensured that
BY.grouped_df
always (by default) returns grouping columns in aggregations i.e.iris |> gby(Species) |> nv() |> BY(sum)
now gives the same asiris |> gby(Species) |> nv() |> fsum()
. -
A
.
was added to the first argument of functionsfselect
,fsubset
,colorder
andfgroup_by
, i.e.fselect(x, ...) -> fselect(.x, ...)
. The reason for this is that over time I added the option to select-rename columns e.g.fselect(mtcars, cylinders = cyl)
, which was not offered when these functions were created. This presents problems if columns should be renamed intox
, e.g.fselect(mtcars, x = cyl)
failed, see #221. Renaming the first argument to.x
somewhat guards against such situations. I think this change is worthwhile to implement, because it makes the package more robust going forward, and usually the first argument of these functions is never invoked explicitly. I really hope this breaks nobody's code. -
Added a function
GRPN
to make it easy to add a column of group sizes e.g.mtcars %>% fgroup_by(cyl,vs,am) %>% ftransform(Sizes = GRPN(.))
ormtcars %>% ftransform(Sizes = GRPN(list(cyl, vs, am)))
orGRPN(mtcars, by = ~cyl+vs+am)
. -
Added
[.pwcor
and[.pwcov
, to be able to subset correlation/covariance matrices without loosing the print formatting.