Skip to content

Remove default n values in epi_slide and epix_slide #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.0
RoxygenNote: 7.2.1
Depends:
R (>= 2.10)
URL: https://cmu-delphi.github.io/epiprocess/
2 changes: 1 addition & 1 deletion R/archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ epi_archive =
#' details.
#' @importFrom data.table key
#' @importFrom rlang !! !!! enquo enquos is_quosure sym syms
slide = function(f, ..., n = 7, group_by, ref_time_values,
slide = function(f, ..., n, group_by, ref_time_values,
time_step, new_col_name = "slide_value",
as_list_col = FALSE, names_sep = "_",
all_rows = FALSE) {
Expand Down
4 changes: 2 additions & 2 deletions R/methods-epi_archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ epix_merge = function(x, y, ..., locf = TRUE, nan = NA) {
#' @param n Number of time steps to use in the running window. For example, if
#' `n = 7`, and one time step is one day, then to produce a value on January 7
#' we apply the given function or formula to data in between January 1 and
#' 7. Default is 7.
#' 7.
#' @param group_by The variable(s) to group by before slide computation. If
#' missing, then the keys in the underlying data table, excluding `time_value`
#' and `version`, will be used for grouping. To omit a grouping entirely, use
Expand Down Expand Up @@ -202,7 +202,7 @@ epix_merge = function(x, y, ..., locf = TRUE, nan = NA) {
#' group_by = geo_value,
#' ref_time_values = time_values,
#' new_col_name = 'case_rate_3d_av')
epix_slide = function(x, f, ..., n = 7, group_by, ref_time_values,
epix_slide = function(x, f, ..., n, group_by, ref_time_values,
time_step, new_col_name = "slide_value",
as_list_col = FALSE, names_sep = "_", all_rows = FALSE) {
if (!inherits(x, "epi_archive")) Abort("`x` must be of class `epi_archive`.")
Expand Down
4 changes: 2 additions & 2 deletions R/slide.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @param n Number of time steps to use in the running window. For example, if
#' `n = 7`, one time step is one day, and the alignment is "right", then to
#' produce a value on January 7 we apply the given function or formula to data
#' in between January 1 and 7. Default is 7.
#' in between January 1 and 7.
#' @param ref_time_values Time values for sliding computations, meaning, each
#' element of this vector serves as the reference time point for one sliding
#' window. If missing, then this will be set to all unique time values in the
Expand Down Expand Up @@ -114,7 +114,7 @@
#' epi_slide(a = data.frame(cases_2dav = mean(cases),
#' cases_2dma = mad(cases)),
#' n = 2, as_list_col = TRUE)
epi_slide = function(x, f, ..., n = 7, ref_time_values,
epi_slide = function(x, f, ..., n, ref_time_values,
align = c("right", "center", "left"), before, time_step,
new_col_name = "slide_value", as_list_col = FALSE,
names_sep = "_", all_rows = FALSE) {
Expand Down
10 changes: 5 additions & 5 deletions man/as_epi_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/epi_archive.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/epi_slide.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/epix_slide.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.