We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ea65a5 commit ca8ec36Copy full SHA for ca8ec36
src/library/base/R/files.R
@@ -50,10 +50,13 @@ file.show <-
50
for(i in seq_along(files)) {
51
f <- files[i]
52
tf <- tempfile()
53
- tmp <- readLines(f, warn = FALSE)
+ tmp <- list(readBin(f, "raw", file.size(f)))
54
tmp2 <- try(iconv(tmp, encoding, "", "byte"))
55
if(inherits(tmp2, "try-error")) file.copy(f, tf)
56
- else writeLines(tmp2, tf)
+ else {
57
+ tmp2 <- strsplit(tmp2, "\r\n?|\n", perl = TRUE)[[1L]]
58
+ writeLines(tmp2, tf)
59
+ }
60
files[i] <- tf
61
if(delete.file) unlink(f)
62
}
0 commit comments