Skip to content

Commit

Permalink
renamed S3 method argument
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wilsonfreitas committed Jan 14, 2024
1 parent 8302108 commit 2bb3ebc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/getbizdays.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
}

0 comments on commit 2bb3ebc

Please sign in to comment.