diff --git a/NAMESPACE b/NAMESPACE index 10847e6c..bf7460b6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,10 +17,12 @@ S3method(group_by,epi_archive) S3method(group_by,epi_df) S3method(group_by,grouped_epi_archive) S3method(group_by_drop_default,grouped_epi_archive) +S3method(group_modify,epi_df) S3method(groups,grouped_epi_archive) S3method(next_after,Date) S3method(next_after,integer) S3method(print,epi_df) +S3method(summarise,epi_df) S3method(summary,epi_df) S3method(ungroup,epi_df) S3method(ungroup,grouped_epi_archive) @@ -80,6 +82,7 @@ importFrom(dplyr,relocate) importFrom(dplyr,rename) importFrom(dplyr,select) importFrom(dplyr,slice) +importFrom(dplyr,summarise) importFrom(dplyr,ungroup) importFrom(lubridate,days) importFrom(lubridate,weeks) diff --git a/R/methods-epi_df.R b/R/methods-epi_df.R index 503b8add..5d44eae0 100644 --- a/R/methods-epi_df.R +++ b/R/methods-epi_df.R @@ -187,7 +187,7 @@ ungroup.epi_df = function(x, ...) { reclass(x, metadata) } -#' @method unnest epi_df +#' @method group_modify epi_df #' @rdname print.epi_df #' @param data The `epi_df` object. #' @export @@ -195,6 +195,15 @@ group_modify.epi_df = function(.data, .f, ..., .keep = FALSE) { dplyr::dplyr_reconstruct(NextMethod(), .data) } +#' @method summarise epi_df +#' @rdname print.epi_df +#' @param data The `epi_df` object. +#' @importFrom dplyr summarise +#' @export +summarise.epi_df = function(.data, .f, ..., .keep = FALSE) { + dplyr::dplyr_reconstruct(NextMethod(), .data) +} + #' @method unnest epi_df #' @rdname print.epi_df #' @param data The `epi_df` object. diff --git a/man/print.epi_df.Rd b/man/print.epi_df.Rd index 878e7f18..e24ac550 100644 --- a/man/print.epi_df.Rd +++ b/man/print.epi_df.Rd @@ -6,6 +6,7 @@ \alias{group_by.epi_df} \alias{ungroup.epi_df} \alias{group_modify.epi_df} +\alias{summarise.epi_df} \alias{unnest.epi_df} \title{Base S3 methods for an \code{epi_df} object} \usage{ @@ -17,7 +18,9 @@ \method{ungroup}{epi_df}(x, ...) -\method{unnest}{epi_df}(.data, .f, ..., .keep = FALSE) +\method{group_modify}{epi_df}(.data, .f, ..., .keep = FALSE) + +\method{summarise}{epi_df}(.data, .f, ..., .keep = FALSE) \method{unnest}{epi_df}(data, ...) }