-
In
GRP.default()
, the"group.starts"
attribute is always returned, even if there is only one group or every observation is its own group. Thanks @JamesThompsonC (#631). -
Fixed a bug in
pivot()
ifna.rm = TRUE
andhow = "wider"|"recast"
and there are multiplevalue
columns with different missingness patterns. In this casena_omit(values)
was applied with default settings to the original (long) value columns, implying potential loss of information. The fix appliesna_omit(values, prop = 1)
, i.e., only removes completely missing rows. -
qDF()/qDT()/qTBL()
now allow a length-2 vector of names torow.names.col
ifX
is a named atomic vector, e.g.,qDF(fmean(mtcars), c("cars", "mean"))
gives the same aspivot(fmean(mtcars, drop = FALSE), names = list("car", "mean"))
. -
Added a subsection on using internal (ad-hoc) grouping to the collapse for tidyverse users vignette.
-
qsu()
now adds aWeightSum
column giving the sum of (non-zero or missing) weights if thew
argument is used. Thanks @mayer79 for suggesting (#650). For panel data (pid
) the 'Between' sum of weights is also simply the number of groups, and the 'Within' sum of weights is the 'Overall' sum of weights divided by the number of groups. -
Fixed an inaccuracy in
fquantile()/fnth()
with weights: As per documentation the target sum issumwp = (sum(w) - min(w)) * p
, however, in practice, the weight of the minimum element ofx
was used instead of the minimum weight. Since the smallest element in the sample usually has a small weight this was unnoticed for a long while, but thanks to @Jahnic-kb now reported and fixed (#659). -
Fixed a bug in
recode_char()
whenregex = TRUE
and thedefault
argument was used. Thanks @alinacherkas for both reporing and fixing (#654).