Skip to content

Commit 81fdc1e

Browse files
fine tune
1 parent 4f230c2 commit 81fdc1e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
106106
17. `t1 - t2`, where one is an `IDate` and the other is a `Date`, are now consistent with the case where both are `IDate` or both are `Date`, [#4749](https://github.com/Rdatatable/data.table/issues/4749). Thanks @George9000 for the report and @MichaelChirico for the fix.
107107
108-
18. `fwrite` now allows `dec` to be the same as `sep` when writing single-column or zero-row tables, as `sep` and/or `dec` are not used in these cases. [#7227](https://github.com/Rdatatable/data.table/issues/7227). Thanks @MichaelChirico for the report and @venom1204 for the fix.
108+
18. `fwrite` now allows `dec` to be the same as `sep` for edge cases where only one will be written, e.g. 0-row or 1-column tables. [#7227](https://github.com/Rdatatable/data.table/issues/7227). Thanks @MichaelChirico for the report and @venom1204 for the fix.
109109
110110
### NOTES
111111

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 for multi-column tables with >0 rows` = (nrow(x) == 0L || 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)