Skip to content

Commit

Permalink
Add optional switch to ignore warning about separator replacement.
Browse files Browse the repository at this point in the history
  • Loading branch information
dklein-pik committed Jan 10, 2024
1 parent f4828b7 commit c1a4aa3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/read.report.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
#' @export read.report
#' @importFrom utils read.table
#'
read.report <- function(file, as.list = TRUE) { # nolint
read.report <- function(file, as.list = TRUE, ignoreSeparatorWarning = FALSE) { # nolint

.trim <- function(a) return(gsub("(^ +)|( +$)", "", as.character(a)))

Expand All @@ -85,7 +85,9 @@ read.report <- function(file, as.list = TRUE) { # nolint
ndots <- nchar(gsub("[^\\.]*", "", names))
if (any(ndots != ndots[1])) {
names <- gsub("\\.", "p", names)
warning("Replaced some \".\" with \"p\" to prevent misinterpretation as dim separator")
if (!ignoreSeparatorWarning) {
warning("Replaced some \".\" with \"p\" to prevent misinterpretation as dim separator")
}
}
# replace weird ° in tables after sub function evaluation
names <- enc2utf8(names)
Expand Down

0 comments on commit c1a4aa3

Please sign in to comment.