collapse version 1.7.5
collapse 1.7.5
-
In the development version on GitHub, 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)
fails, see e.g. #221 . Renaming the first argument to.x
somewhat guards against such situations. I think this API 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. For now it remains in the development version which you can install usingremotes::install_github("SebKrantz/collapse")
. If you have strong objections to this change (because it will break your code or you know of people that have a programming style where they explicitly set the first argument of data manipulation functions), please let me know! -
Also ensuring tidyverse examples are in
\donttest{}
and building without the dplyr testing file to avoid issues with static code analysis on CRAN. -
20-50% Speed improvement in
gsplit
(and therefore infsummarise
,fmutate
,collap
andBY
when invoked with base R functions) when grouping withGRP(..., sort = TRUE, return.order = TRUE)
. To enable this by default, the default for argumentreturn.order
inGRP
was set tosort
, which retains the ordering vector (needed for the optimization). Retaining the ordering vector uses up some memory which can possibly adversely affect computations with big data, but with big datasort = FALSE
usually gives faster results anyway, and you can also always setreturn.order = FALSE
(also infgroup_by
,collap
), so this default gives the best of both worlds.
- An ancient depreciated argument
sort.row
(replaced bysort
in 2020) is now removed fromcollap
. Also argumentsreturn.order
andmethod
were added tocollap
providing full control of the grouping that happens internally.
collapse 1.7.4
-
Tests needed to be adjusted for the upcoming release of dplyr 1.0.8 which involves an API change in
mutate
.fmutate
will not take over these changes i.e.fmutate(..., .keep = "none")
will continue to work likedplyr::transmute
. Furthermore, no more tests involving dplyr are run on CRAN, and I will also not follow along with any future dplyr API changes. -
The C-API macro
installTrChar
(used in the newmassign
function) was replaced withinstallChar
to maintain backwards compatibility with R versions prior to 3.6.0. Thanks @tedmoorman #213. -
Minor improvements to
group()
, providing increased performance for doubles and also increased performance when the second grouping variable is integer, which turned out to be very slow in some instances.