Skip to content

Commit ac91f25

Browse files
author
ripley
committed
improve r87407
git-svn-id: https://svn.r-project.org/R/trunk@87412 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent e037549 commit ac91f25

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/library/utils/R/write.table.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function (x, file = "", append = FALSE, quote = TRUE, sep = " ",
4343
if(is.null(d[[2L]]) && makeColnames && p > 0L)
4444
d[[2L]] <- paste0("V", 1L:p)
4545
if(qset)
46-
quote <- if(is.character(x)) seq_len(p) else numeric()
46+
quote <- if(is.character(x)) seq_len(p) else integer()
4747
} else { ## data.frame
4848
if(qset)
4949
quote <- if(length(x))
@@ -71,7 +71,7 @@ function (x, file = "", append = FALSE, quote = TRUE, sep = " ",
7171
nocols <- p == 0L
7272

7373
if(is.logical(quote)) # must be false
74-
quote <- integer(0) # NULL
74+
quote <- NULL
7575
else if(is.numeric(quote)) {
7676
if(any(quote < 1L | quote > p))
7777
stop("invalid numbers in 'quote'")
@@ -139,6 +139,7 @@ function (x, file = "", append = FALSE, quote = TRUE, sep = " ",
139139
x[needconv] <- lapply(x[needconv], as.character)
140140
}
141141

142+
if (is.null(quote)) quote <- integer(0)
142143
invisible(.External2(C_writetable, x, file, nrow(x), p, rnames, sep, eol,
143144
na, dec, as.integer(quote), qmethod != "double"))
144145
}

0 commit comments

Comments
 (0)