Skip to content

Commit e071c28

Browse files
committed
Address review comments.
1 parent f79fc6e commit e071c28

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

R/fread.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ yaml=FALSE, tmpdir=tempdir(), tz="UTC")
5555
else stopifnot( nchar(sep)==1L ) # otherwise an actual character to use as sep
5656
}
5757
stopifnot( is.character(dec), length(dec)==1L)
58-
if (!is.na(dec) && dec == "auto") dec = "" else stopifnot(nchar(dec) == 1L)
58+
if (identical(dec, "auto")) dec = "" else stopifnot(nchar(dec) == 1L)
5959
# handle encoding, #563
6060
if (length(encoding) != 1L || !encoding %chin% c("unknown", "UTF-8", "Latin-1")) {
6161
stopf("Argument 'encoding' must be 'unknown', 'UTF-8' or 'Latin-1'.")

inst/tests/tests.Rraw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21607,4 +21607,4 @@ test(2370.4, yearmon("2016-08-03 01:02:03.45", format="character"), "2016M08")
2160721607
test(2370.5, yearmon(NA, format="character"), NA_character_)
2160821608

2160921609
## validation of dec argument
21610-
test(7737.1, fread(input = "whatever.csv", dec = NA_character_), error="nchar(dec) == 1L is not TRUE")
21610+
test(7737.1, fread(input = "whatever.csv", dec = NA_character_), error=base_messages$stopifnot("nchar(dec) == 1L"))

0 commit comments

Comments
 (0)