Skip to content

Commit 885bdb3

Browse files
Merge pull request #6831 from Rdatatable/depr-logasint
Remove defunct 'logicalAsInt` from fwrite
2 parents c1d04a4 + 057adb3 commit 885bdb3

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

NEWS.md

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
1. Continued work to remove non-API C functions, [#6180](https://github.com/Rdatatable/data.table/issues/6180). Thanks Ivan Krylov for the PRs and for writing a clear and concise guide about the R API: https://aitap.codeberg.page/R-api/.
2020

21+
2. The following in-progress deprecations have proceeded:
22+
23+
+ Argument `logicalAsInt` to `fwrite()` has been removed.
24+
2125
# data.table [v1.17.0](https://github.com/Rdatatable/data.table/milestone/34) (20 Feb 2025)
2226

2327
## POTENTIALLY BREAKING CHANGES

R/fwrite.R

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
33
sep2=c("","|",""), eol=if (.Platform$OS.type=="windows") "\r\n" else "\n",
44
na="", dec=".", row.names=FALSE, col.names=TRUE,
55
qmethod=c("double","escape"),
6-
logical01=getOption("datatable.logical01", FALSE), # due to change to TRUE; see NEWS
7-
logicalAsInt=NULL,
6+
logical01=getOption("datatable.logical01", FALSE),
87
scipen=getOption('scipen', 0L),
98
dateTimeAs = c("ISO","squash","epoch","write.csv"),
109
buffMB=8L, nThread=getDTthreads(verbose),
@@ -23,9 +22,6 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
2322
compress = match.arg(compress)
2423
dateTimeAs = match.arg(dateTimeAs)
2524
dateTimeAs = chmatch(dateTimeAs, c("ISO", "squash", "epoch", "write.csv")) - 1L
26-
if (!is.null(logicalAsInt)) {
27-
stopf("logicalAsInt has been renamed logical01 for consistency with fread.")
28-
}
2925
scipen = if (is.numeric(scipen)) as.integer(scipen) else 0L
3026
buffMB = as.integer(buffMB)
3127
nThread = as.integer(nThread)

inst/tests/tests.Rraw

+1-1
Original file line numberDiff line numberDiff line change
@@ -10933,7 +10933,7 @@ test(1736.03, fwrite(DT, sep2=c("",",","")), error="sep.*,.*sep2.*,.*must all be
1093310933
test(1736.04, fwrite(DT, sep2=c("","||","")), error="nchar.*sep2.*2")
1093410934
test(1736.05, capture.output(fwrite(DT, sep='|', sep2=c("c(",",",")"), logical01=FALSE)), c("A|B|C", "1|c(1,2,3,4,5,6,7,8,9,10)|c(s,t,u,v,w)",
1093510935
"2|c(15,16,17,18)|c(1.2,2.3,3.4,3.14159265358979,-9)", "3|c(7)|c(foo,bar)", "4|c(9,10)|c(TRUE,TRUE,FALSE)"))
10936-
test(1736.06, fwrite(DT, sep='|', sep2=c("{",",","}"), logicalAsInt=TRUE), error="logicalAsInt has been renamed logical01")
10936+
# 1736.06 was of defunct logicalAsInt argument
1093710937
DT = data.table(A=c("foo","ba|r","baz"))
1093810938
test(1736.07, capture.output(fwrite(DT,na="")), c("A","foo","ba|r","baz")) # no list column so no need to quote
1093910939
test(1736.08, capture.output(fwrite(DT)), c("A","foo","ba|r","baz"))

man/fwrite.Rd

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ fwrite(x, file = "", append = FALSE, quote = "auto",
1212
na = "", dec = ".", row.names = FALSE, col.names = TRUE,
1313
qmethod = c("double","escape"),
1414
logical01 = getOption("datatable.logical01", FALSE), # due to change to TRUE; see NEWS
15-
logicalAsInt = NULL, # deprecated
1615
scipen = getOption('scipen', 0L),
1716
dateTimeAs = c("ISO","squash","epoch","write.csv"),
1817
buffMB = 8L, nThread = getDTthreads(verbose),
@@ -42,7 +41,6 @@ fwrite(x, file = "", append = FALSE, quote = "auto",
4241
\item "double" (default, same as \code{write.csv}), in which case the double quote is doubled with another one.
4342
}}
4443
\item{logical01}{Should \code{logical} values be written as \code{1} and \code{0} rather than \code{"TRUE"} and \code{"FALSE"}?}
45-
\item{logicalAsInt}{Deprecated. Old name for `logical01`. Name change for consistency with `fread` for which `logicalAsInt` would not make sense.}
4644
\item{scipen}{ \code{integer} In terms of printing width, how much of a bias should there be towards printing whole numbers rather than scientific notation? See Details. }
4745
\item{dateTimeAs}{ How \code{Date}/\code{IDate}, \code{ITime} and \code{POSIXct} items are written.
4846
\itemize{

0 commit comments

Comments
 (0)