From 2bb3ebce5000785d99741254460e1eaf01a6cd96 Mon Sep 17 00:00:00 2001 From: wilsonfreitas Date: Sun, 14 Jan 2024 17:50:51 -0300 Subject: [PATCH] renamed S3 method argument the arguments in S3 methods must match exactly. the first one is the most important, it is used to dispatch the generics, so to be consistent, it must have the same name in the generics implementations. --- R/getbizdays.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/getbizdays.R b/R/getbizdays.R index 043bb38..18c2428 100644 --- a/R/getbizdays.R +++ b/R/getbizdays.R @@ -38,13 +38,13 @@ count_bizdays <- function(x, cal, ref_pos) { UseMethod("count_bizdays") } -count_bizdays.by_month <- function(ref, cal, ref_pos) { - ix <- cal$dates.table[, "month"] == ref$ref_table[ref_pos, "month"] & - cal$dates.table[, "year"] == ref$ref_table[ref_pos, "year"] +count_bizdays.by_month <- function(x, cal, ref_pos) { + ix <- cal$dates.table[, "month"] == x$ref_table[ref_pos, "month"] & + cal$dates.table[, "year"] == x$ref_table[ref_pos, "year"] sum(cal$dates.table[ix, "is_bizday"]) } -count_bizdays.by_year <- function(ref, cal, ref_pos) { - ix <- cal$dates.table[, "year"] == ref$ref_table[ref_pos, "year"] +count_bizdays.by_year <- function(x, cal, ref_pos) { + ix <- cal$dates.table[, "year"] == x$ref_table[ref_pos, "year"] sum(cal$dates.table[ix, "is_bizday"]) } \ No newline at end of file