Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove defunct 'logicalAsInt` from fwrite #6831

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# data.table [v1.17.99](https://github.com/Rdatatable/data.table/milestone/35) (in development)

## NOTES

1. The following in-progress deprecations have proceeded:

+ Argument `logicalAsInt` to `fwrite()` has been removed.

# data.table [v1.17.0](https://github.com/Rdatatable/data.table/milestone/34) (20 Feb 2025)

Expand Down
6 changes: 1 addition & 5 deletions R/fwrite.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
sep2=c("","|",""), eol=if (.Platform$OS.type=="windows") "\r\n" else "\n",
na="", dec=".", row.names=FALSE, col.names=TRUE,
qmethod=c("double","escape"),
logical01=getOption("datatable.logical01", FALSE), # due to change to TRUE; see NEWS
logicalAsInt=NULL,
logical01=getOption("datatable.logical01", FALSE),
scipen=getOption('scipen', 0L),
dateTimeAs = c("ISO","squash","epoch","write.csv"),
buffMB=8L, nThread=getDTthreads(verbose),
Expand All @@ -23,9 +22,6 @@ fwrite = function(x, file="", append=FALSE, quote="auto",
compress = match.arg(compress)
dateTimeAs = match.arg(dateTimeAs)
dateTimeAs = chmatch(dateTimeAs, c("ISO", "squash", "epoch", "write.csv")) - 1L
if (!is.null(logicalAsInt)) {
stopf("logicalAsInt has been renamed logical01 for consistency with fread.")
}
scipen = if (is.numeric(scipen)) as.integer(scipen) else 0L
buffMB = as.integer(buffMB)
nThread = as.integer(nThread)
Expand Down
2 changes: 1 addition & 1 deletion inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -10930,7 +10930,7 @@ test(1736.03, fwrite(DT, sep2=c("",",","")), error="sep.*,.*sep2.*,.*must all be
test(1736.04, fwrite(DT, sep2=c("","||","")), error="nchar.*sep2.*2")
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)",
"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)"))
test(1736.06, fwrite(DT, sep='|', sep2=c("{",",","}"), logicalAsInt=TRUE), error="logicalAsInt has been renamed logical01")
# 1736.06 was of defunct logicalAsInt argument
DT = data.table(A=c("foo","ba|r","baz"))
test(1736.07, capture.output(fwrite(DT,na="")), c("A","foo","ba|r","baz")) # no list column so no need to quote
test(1736.08, capture.output(fwrite(DT)), c("A","foo","ba|r","baz"))
Expand Down
2 changes: 0 additions & 2 deletions man/fwrite.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ fwrite(x, file = "", append = FALSE, quote = "auto",
na = "", dec = ".", row.names = FALSE, col.names = TRUE,
qmethod = c("double","escape"),
logical01 = getOption("datatable.logical01", FALSE), # due to change to TRUE; see NEWS
logicalAsInt = NULL, # deprecated
scipen = getOption('scipen', 0L),
dateTimeAs = c("ISO","squash","epoch","write.csv"),
buffMB = 8L, nThread = getDTthreads(verbose),
Expand Down Expand Up @@ -42,7 +41,6 @@ fwrite(x, file = "", append = FALSE, quote = "auto",
\item "double" (default, same as \code{write.csv}), in which case the double quote is doubled with another one.
}}
\item{logical01}{Should \code{logical} values be written as \code{1} and \code{0} rather than \code{"TRUE"} and \code{"FALSE"}?}
\item{logicalAsInt}{Deprecated. Old name for `logical01`. Name change for consistency with `fread` for which `logicalAsInt` would not make sense.}
\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. }
\item{dateTimeAs}{ How \code{Date}/\code{IDate}, \code{ITime} and \code{POSIXct} items are written.
\itemize{
Expand Down
Loading