Skip to content

Commit

Permalink
fix(preprocessing): fix weird lintr error
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft committed Nov 18, 2024
1 parent 3f592db commit 80a5b84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions preprocessing/R/utils-low_frequencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#' @return A numeric vector with low frequencies replaced
#' @keywords internal
replace_low_frequencies <- function(df, cols, threshold, replacement) {
threshold_num <- .as_numeric(threshold, "threshold")
replacement_num <- .as_numeric(replacement, "replacement")
threshold <- .as_numeric(threshold, "threshold")
replacement <- .as_numeric(replacement, "replacement")

# Remove records with values equal to 0
df <- dplyr::filter(df, dplyr::if_all(dplyr::all_of(cols), ~ . > 0))
Expand All @@ -22,7 +22,7 @@ replace_low_frequencies <- function(df, cols, threshold, replacement) {
dplyr::mutate(
df, dplyr::across(
dplyr::all_of(cols),
~ ifelse(.x < threshold_num, replacement_num, .x)
~ ifelse(.x < threshold, replacement, .x)
)
)
}
Expand Down

0 comments on commit 80a5b84

Please sign in to comment.