Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 27, 2023
1 parent db9aa8e commit e798cfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions R/data_tabulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ data_tabulate.grouped_df <- function(x,
for (i in seq_along(grps)) {
rows <- grps[[i]]
# save information about grouping factors
if (!is.null(group_variables)) {
group_variable <- group_variables[i, , drop = FALSE]
} else {
if (is.null(group_variables)) {
group_variable <- NULL
} else {
group_variable <- group_variables[i, , drop = FALSE]
}
out <- c(out, data_tabulate(
data_filter(x, rows),
Expand Down Expand Up @@ -226,7 +226,7 @@ format.dw_data_tabulate <- function(x, format = "text", big_mark = NULL, ...) {
# format data frame
ftab <- insight::format_table(x, ...)
ftab[] <- lapply(ftab, function(i) {
i[i == ""] <- ifelse(identical(format, "text"), "<NA>", "(NA)")
i[i == ""] <- ifelse(identical(format, "text"), "<NA>", "(NA)") # nolint
i
})
ftab$N <- gsub("\\.00$", "", ftab$N)
Expand Down
8 changes: 4 additions & 4 deletions R/to_numeric.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ to_numeric.data.frame <- function(x,
# drop numerics, when append is not FALSE
select <- colnames(x[select])[!vapply(x[select], is.numeric, FUN.VALUE = logical(1L))]
# process arguments
args <- .process_append(
fun_args <- .process_append(
x,
select,
append,
append_suffix = "_n",
keep_factors = TRUE
)
# update processed arguments
x <- args$x
select <- args$select
x <- fun_args$x
select <- fun_args$select
}

out <- sapply(
Expand Down Expand Up @@ -129,7 +129,7 @@ to_numeric.data.frame <- function(x,
}

# due to the special handling of dummy factors, we need to take care
# of appending the data here again. usually, "args$x" includes the appended
# of appending the data here again. usually, "fun_args$x" includes the appended
# data, which does not work here...

if (!isFALSE(append)) {
Expand Down

0 comments on commit e798cfb

Please sign in to comment.