Skip to content

Commit 6f917da

Browse files
use NROW/NCOL for more robust input checking
1 parent 81fdc1e commit 6f917da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

R/fwrite.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
4444
is.character(sep) && length(sep)==1L && (nchar(sep) == 1L || identical(sep, "")),
4545
is.character(sep2) && length(sep2)==3L && nchar(sep2[2L])==1L,
4646
is.character(dec) && length(dec)==1L && nchar(dec) == 1L,
47-
`dec and sep must be distinct whenever both might be needed` = (!nrow(x) || ncol(x) <= 1L || dec != sep), # sep2!=dec and sep2!=sep checked at C level when we know if list columns are present
47+
`dec and sep must be distinct whenever both might be needed` = (!NROW(x) || NCOL(x) <= 1L || dec != sep), # sep2!=dec and sep2!=sep checked at C level when we know if list columns are present
4848
is.character(eol) && length(eol)==1L,
4949
length(qmethod) == 1L && qmethod %chin% c("double", "escape"),
5050
length(compress) == 1L && compress %chin% c("auto", "none", "gzip"),

0 commit comments

Comments
 (0)