Closed kinto-b closed 3 years ago
Yeah maybe just a "weight" argument that defaults to 1 and multiplies both the base and vals? (and is ignored when summarised)
Yeah, I like that -- do you think do that for col_freq
and spec_col_freq
or just the latter?
I don't mind the API for col_freq
as it's a bit more transparent what's going on than would be with a separate argument, but documenting that behaviour would be slightly more annoying
I tihnk for col_freq as well, it's a bit cleaner from a usability perspective, so you can do things like:
Unweighted = col_freq(x %in% 1, x %in% 0:1),
Weighted = col_freq(x %in% 1, x %in% 0:1, weight = wgt),
Currently you can do weighted frequencies with
I sort of like that approach, but possibly having a dedicated argument would make things more usable.
More importantly though, there's no way to stipulate weights when using
spec_col_freq