You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use dplyr_extending, don't ungroup in epix_slide, back to group_modify
* Implement `?dplyr_extending` and remove some now-unnecessary S3 methods for
dplyr verbs, addressing #195, #223, and failing `epix_slide` test.
* Don't ungroup `epix_slide` result. Update corresponding test.
* Update NEWS.md.
* Explicate `epix_slide` `count` derivation in comments and variable names.
* Fix some desynced duplicated code in `epix_slide` and use `group_modify` again
instead of `summarize` in order to keep slide computation input available as
an `epi_df`.
# Same idea as above, but accounting for `duplicated` not
258
+
# working as we want on 0 columns. (Should be the same as if
259
+
# we were counting distinct values of a column defined as
260
+
# `rep(val, target_n_rows)`.)
261
+
if (nrow(.data_group) ==0L) {
262
+
0L
263
+
} else {
264
+
1L
265
+
}
266
+
}
236
267
237
268
# If we get back an atomic vector
238
269
if (is.atomic(comp_value)) {
@@ -241,7 +272,7 @@ grouped_epi_archive =
241
272
}
242
273
# If not a singleton, should be the right length, else abort
243
274
elseif (length(comp_value) !=count) {
244
-
Abort("If the slide computation returns an atomic vector, then it must have a single element, or else one element per appearance of the reference time value in the local window.")
275
+
Abort('If the slide computation returns an atomic vector, then it must have either (a) a single element, or (b) one element per distinct combination of key variables, excluding the `time_value`, `version`, and grouping variables, that is present in the first argument to the computation.')
0 commit comments