similar to: Handling Error Thrown After source(...), read.table(...), and readLines(...)

Displaying 20 results from an estimated 20000 matches similar to: "Handling Error Thrown After source(...), read.table(...), and readLines(...)"

2009 May 05
1
self organizing map advice for categorical data
Hello, Could anybody offer any advice about implementing a Kohonen self organizing map for categorical data? Specifically I am wondering if there are any pre-existent packages that can deal with categorical data and/or how one would compare the input vector of categoricals with the self organizing map nodes. Thanks in advance. George Chen ----- Original Message ----- From: r-help-request at
2018 Apr 26
0
readLines() for non-blocking pipeline behaves differently in R 3.5
I suspect the reason for the seek is this: cat("1\n", file = "foobar") f <- file("foobar", blocking = FALSE, open = "r") readLines(f) #> [1] "1" cat("2\n", file = "foobar", append = TRUE) readLines(f) #> [1] "2" cat("3\n", file = "foobar", append = TRUE) readLines(f) #> [1]
2008 Sep 23
2
read.table & readLines behaviour?
Hi, I have been using 'read.table' regularly to read tab-delimited text files with data. No problem, until now. Now I have a file that appeared to have read fine, and the data inside looks correct (structure etc), except I only had 15000+ rows out of the expected 24000. Using 'readLines' instead, and breaking up the data by tabs, gives me the expected result. I do not
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
On Thu, Dec 14, 2017 at 12:17 PM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote: > On Thu, Dec 14, 2017 at 7:56 PM, Gabriel Becker <gmbecker at ucdavis.edu> > wrote: > > Gabor, > > > > You can grab the connection and destroy it via getConnection and then a > > standard close call. > > Yeah, that's often a possible workaround, but since this
2004 Jan 12
1
ReadLines does not give results with urls
Hello, I am using R version 1.8.1 on a linux machine (Suse 8.2.). I have problems to use readLines() with urls. This seems to be a problem with our proxy-server. Downloading files work with download.file() with wget but not without: > download.file(url = "http://cran.r-project.org/src/contrib/PACKAGES", destfile = "test.txt", method = "wget", cacheOK = FALSE)
2018 May 10
0
readLines() behaves differently for gzfile connection
Would it be possible to get that file or a representative subset of it somewhere so that I can reproduce this? Thanks, Michael On Thu, May 10, 2018 at 3:31 PM, Ben Heavner <bheavner at gmail.com> wrote: > When I read a .gz file with readLines() in 3.4.3, it returns text (and a > warning). In 3.5.0, it gives a warning, but no text. Is this expected > behavior or a bug? > >
2018 Jun 13
0
readLines function with R >= 3.5.0
Hi Jen, This was already resolved for R 3.5.1 by just disabling buffering on terminal file connections like stdin. Sounds like you might want to be running a web service or something instead though. Michael On Tue, Jun 12, 2018 at 4:46 PM, Jennifer Lyon <jennifer.s.lyon at gmail.com> wrote: > Hi: > > I have also just stumbled into this bug. Unfortunately, I can not > change
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
Gabor, You can grab the connection and destroy it via getConnection and then a standard close call. (it actually lists that it is "closed" already, but still in the set of existing connections. I can't speak to that difference). > tryCatch( + readLines(tempfile(), warn = FALSE)[1], + error = function(e) NA, + warning = function(w) NA + ) [1] NA >
2011 Oct 03
2
file input with readLines
I am using readLines to read a fairly large ASCII file. readLines reads a fixed number of lines, then other R code processes the data, then readLines reads the same number of lines again, then other R code processes the data, then .... Sort of like: conn<-file('filename','r') for (chunk in 1:100000) { Lines<-readLines(conn,n=25) # process "Lines" }
2017 Dec 14
0
cannot destroy connection (?) created by readLines in a tryCatch
This has nothing to do with on.exit. It is an iteraction between where the warning is signaled in 'file' and your _exiting_ warning handler. This combination has the same issue, tryCatch(file(tempfile(), "r"), warning = identity) showConnections(all = TRUE) as does options(warn=2) file(tempfile(), "r") showConnections(all = TRUE) I haven't looked at the
2016 Jun 08
0
readlines() truncates text file with Codepage 437 encoding
Appended is the file -- you need to tell your e-mail software to use one of the MIME types that R-devel does accept; text/plain is what I chose ((Yes, as R mailing list server "operator", with a bit of detective work, I was able to find the "uncleaned" e-mail and extract the attachment from it)) Martin Maechler ETH Zurich -------------- next part -------------- An
2018 May 28
0
readLines function with R >= 3.5.0
stdin() is not the same as file("stdin"), see the note in ?stdin. Gabor On Mon, 28 May 2018, 10:41 Martin Maechler, <maechler at stat.math.ethz.ch> wrote: > >>>>> Martin Maechler > >>>>> on Mon, 28 May 2018 10:28:01 +0200 writes: > > >>>>> Ralf Stubner > >>>>> on Fri, 25 May 2018 19:18:58 +0200
2018 Jun 13
0
readLines function with R >= 3.5.0
Are you sure it's not available in patched? It's definitely in the source since 6/1. Michael On Wed, Jun 13, 2018 at 2:19 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>>>>> Michael Lawrence >>>>>> on Tue, 12 Jun 2018 19:27:49 -0700 writes: > > > Hi Jen, This was already resolved for R 3.5.1 by just > >
2001 Oct 02
0
An example (was RE: file connection, while, readLines and bro wser)
Prof. Gentleman (and R-help), Here's an example of what didn't work. I still don't understand why. Function: trycon <- function(file, n) { f.con <- file(file, open="rt") on.exit(close(f.con)) i <- 0 while( length(readln <- readLines(f.con, 1)) > 0 ) { x <- unlist(strsplit(readln, " ")) if(length(x) <= 6 && x[3] ==
2017 Sep 02
0
readLines() segfaults on large file & question on how to work around
As s work-around I suggest readr::read_file. --Ista On Sep 2, 2017 2:58 PM, "Jennifer Lyon" <jennifer.s.lyon at gmail.com> wrote: > Hi: > > I have a 2.1GB JSON file. Typically I use readLines() and > jsonlite:fromJSON() to extract data from a JSON file. > > When I try and read in this file using readLines() R segfaults. > > I believe the two salient
2004 May 07
1
Problem (Bug?) with readLines on Suze
Hello, I called readLines on Suze 9.0 with a directory as parameter instead of a file. R freezed for a very long time; this morning I could read following error message: Error in readLines(paste("/home/",foo,"/",sep="")) : cannot allocate buffer in readLines under W2K I get a more logical error ("cannot open file") (I'm still using R 1.8.1)
2018 May 10
1
readLines() behaves differently for gzfile connection
You bet - it's available on github at https://github.com/UW-GAC/wgsaparsr/blob/master/tests/testthat/1k_annotation.gz -Ben On Thu, May 10, 2018 at 4:17 PM, Michael Lawrence <lawrence.michael at gene.com > wrote: > Would it be possible to get that file or a representative subset of it > somewhere so that I can reproduce this? > > Thanks, > Michael > > On Thu, May
2011 Dec 24
2
readLines errors
Hi All, I met a problem using readLines function to return the data from Google maps. readLines(url(" http://ditu.google.cn/maps/geo?q=+qianshuichong,+guichi+anhui,+CN&output=csv&key=ABQIAAAAq8Fnd_oUka-7RdS6BrD7GBTqeABoQuNTXS36G_rkiwQnKRW6GBTkns8JpKz6y6dScgB8827dlddUlg"), n=1, warn=FALSE) [1] "200,4,30.6528380,117.4872250" The above code is ok because the
2013 Apr 10
1
Issue with Control-Z in a text file on Windows - readLines() appears to truncate
Working on Windows I have had to deal with CSV files that, unfortunately, contain embedded Control-Zs, i.e. ASCII character 26 in decimal, and the readLines() function in R on Windows (2.15.2 and 3.0.0) appears to truncate at the control-Z. There is no problem at all on Ubuntu Linux with R 3.0.0. Am I mistaken or is this genuine? # Create a small file with embedded Control-Z h3 <-
2018 May 28
2
readLines function with R >= 3.5.0
>>>>> Martin Maechler >>>>> on Mon, 28 May 2018 10:28:01 +0200 writes: >>>>> Ralf Stubner >>>>> on Fri, 25 May 2018 19:18:58 +0200 writes: >> Dear all, I would like to draw you attention to this >> question on SO: >>