From db9aa8e8d43e30bd88af27156b1fe97bdb24e9a7 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 27 Nov 2023 17:55:03 +0100 Subject: [PATCH] lintr --- R/data_tabulate.R | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/R/data_tabulate.R b/R/data_tabulate.R index 3b16932a3..98574d4a5 100644 --- a/R/data_tabulate.R +++ b/R/data_tabulate.R @@ -347,10 +347,10 @@ print.dw_data_tabulates <- function(x, big_mark = NULL, ...) { } } else { x <- lapply(x, function(i) { - attr <- attributes(i) + i_attr <- attributes(i) i <- format(i, format = "text", big_mark = big_mark, ...) - i$Variable[attr$duplicate_varnames] <- "" - if (!is.null(i$Group)) i$Group[attr$duplicate_varnames] <- "" + i$Variable[i_attr$duplicate_varnames] <- "" + if (!is.null(i$Group)) i$Group[i_attr$duplicate_varnames] <- "" i[nrow(i) + 1, ] <- "" i }) @@ -375,9 +375,9 @@ print_html.dw_data_tabulates <- function(x, big_mark = NULL, ...) { print_html(x[[1]], big_mark = big_mark, ...) } else { x <- lapply(x, function(i) { - attr <- attributes(i) + i_attr <- attributes(i) i <- format(i, format = "html", big_mark = big_mark, ...) - i$Variable[attr$duplicate_varnames] <- "" + i$Variable[i_attr$duplicate_varnames] <- "" i }) @@ -401,10 +401,10 @@ print_md.dw_data_tabulates <- function(x, big_mark = NULL, ...) { print_md(x[[1]], big_mark = big_mark, ...) } else { x <- lapply(x, function(i) { - attr <- attributes(i) + i_attr <- attributes(i) i <- format(i, format = "markdown", big_mark = big_mark, ...) - i$Variable[attr$duplicate_varnames] <- "" - if (!is.null(i$Group)) i$Group[attr$duplicate_varnames] <- "" + i$Variable[i_attr$duplicate_varnames] <- "" + if (!is.null(i$Group)) i$Group[i_attr$duplicate_varnames] <- "" i[nrow(i) + 1, ] <- "" i })