Displaying 20 results from an estimated 8000 matches similar to: "errors in getconnection or scan"
2017 Dec 14
4
cannot destroy connection (?) created by readLines in a tryCatch
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 connection
was opened by
readLines() internally, I don't necessarily know which one it is. E.g.
I might open multiple
2007 Nov 14
1
isOpen on closed connections
As far as I can tell, 'isOpen' cannot return FALSE in the case when 'rw = ""'.
If the connection has already been closed by 'close' or some other function,
then isOpen will produce an error. The problem is that when isOpen calls
'getConnection', the connection cannot be found and 'getConnection' produces an
error. The check to see if it is
2017 Dec 15
1
cannot destroy connection (?) created by readLines in a tryCatch
Thanks for tracking this down. Yeah, I should use suppressWarnings(),
you are right.
Although, readLines() might throw another warning, e.g. for incomplete
last lines,
and you don't necessarily want to suppress that.
TBH I am not sure why that warning is given:
? con <- file(tempfile())
? open(con)
Error in open.connection(con) : cannot open the connection
In addition: Warning message:
In
2007 May 24
2
object getConnection
Hi,
I use the functions socketConnections() and getConnection()
which are working fine. Thanks to the authors.
After opening nicely some socketConnection,
getConnection(3) returns something like :
description class mode text opened can read can write
"->127.0.0.1:7496" "socket" "wb" "binary" "opened" "yes"
2009 Nov 07
1
getConnection, R_outpstream_st
Hello,
I'm trying to use the limited connections api defined in Rinternals.h. I
have code that looks like this (inspired from do_serializeToConn) :
SEXP serialize_to_connection( SEXP xp, SEXP connection ){
Rconnection con ;
struct R_outpstream_st out;
R_pstream_format_t type = R_pstream_binary_format ;
SEXP (*hook)(SEXP, SEXP) = NULL ;
con = getConnection(Rf_asInteger(connection));
2017 Dec 14
2
cannot destroy connection (?) created by readLines in a tryCatch
Consider this code. This is R 3.4.2, but based on a quick look at the
NEWS, this has not been fixed.
tryCatch(
readLines(tempfile(), warn = FALSE)[1],
error = function(e) NA,
warning = function(w) NA
)
rm(list=ls(all.names = TRUE))
gc()
showConnections(all = TRUE)
If you run it, you'll get a connection you cannot close(), i.e. the
last showConnections() call prints:
?
2007 Apr 06
1
getConnection is not found in R depending on the Linux flavour (RedHat or Debian) - dyn.load problems
Hello R developers,
I am working on the "seqinr" package and I encounter a tricky problem
using a C
function.
We defined a C fonction called "getzlibsock" which is dedicated to
compressed
socket connections. This function is using the R internal C function
called "getConnection(int)" in order to get information about the socket
previously opened with the
2006 Oct 07
1
Request to open up getConnection to embedded interface
Hello all,
I would like to request that getConnection() and the struct Rconn
declarations be added to the R embedded interface. Here's why.
It's common in CGI scripts for web applications to direct stdin, stdout,
and stderr map to reading from the browser, writing to the browser, and
writing to a web log file respectively; very nice and neat. However,
things get a little hairy once
2018 Oct 31
1
PATCH: Asserting that 'connection' used has not changed + R_GetConnection2()
SUMMARY:
I'm proposing that R assert that 'connection' options have not changed
since first created such that R will produce the following error:
> fh <- file("a.txt", open = "w+")
> cat("hello\n", file = fh)
> close(fh)
> fh2 <- file("b.txt", open = "w+")
> cat("world\n", file = fh2)
>
2006 May 26
2
Too many open files
This may be more of an OS question ...
I have this call
r = get.hist.quote(symbol, start= format(start, "%Y-%m-%d"), end=
format(end, "%Y-%m-%d"))
which does a url request
in a loop and my program runs out of file handlers after few hundred
rotations. The error message is: 'Too many open files'. Other than
increasing the file handlers assigned to my process, is there
2015 Apr 17
1
behavior of as.integer("5000000000")
>>>>> Martin Maechler <maechler at lynne.stat.math.ethz.ch>
>>>>> on Fri, 17 Apr 2015 15:49:35 +0200 writes:
>>>>> Herv? Pag?s <hpages at fredhutch.org>
>>>>> on Mon, 13 Apr 2015 23:36:14 -0700 writes:
>> On 04/13/2015 11:32 PM, Martin Maechler wrote:
>>>
>>>> Hi,
2015 Apr 14
3
behavior of as.integer("5000000000")
On 04/13/2015 11:32 PM, Martin Maechler wrote:
>
>> Hi,
>> > as.integer("5000000000")
>> [1] 2147483647
>> Warning message:
>> inaccurate integer conversion in coercion
>
>> > as.integer("-5000000000")
>> [1] NA
>> Warning message:
>> inaccurate integer conversion in coercion
>
2007 May 30
5
Possible changes to connections
When I originally implemented connections in R 1.2.0, I followed the model
in the 'Green Book' closely. There were a number of features that forced
a particular implementation, and one was getConnection() that allows one
to recreate a connection object from a number.
I am wondering if anyone makes use of this, and if so for what?
It would seem closer to the R philosophy to have
2012 Oct 04
1
Intermittent connectivity issues for JDBC / Oracle
I have been experiencing issues with an R script hanging when connecting to
an Oracle database. To help debug, I found a function here in the nabble
forum and made a small test script:
#!/usr/bin/Rscript --no-restore --no-save --no-init-file
library("RJDBC")
drv<-JDBC("oracle.jdbc.OracleDriver","/home/oracle/lib/ojdbc6.jar", "'")
dbCheck =
2001 Oct 02
1
connections: remember to close it!
Hi all,
I have newly discovered the power of connections (although just a small part
of it, namely the file() connection). It allowed me to process data file
with arbitrary number of fields per line, which I was using awk for
preprocessing before readling into R. The combination of the connection,
readLines() and strsplit() really make the work a lot easier and more
organized. Thanks a bundle
2011 Mar 28
1
use scan("http://www.example.com/file.htm") with an hidden-fake IP adress
Dear users,
I am currently using scan(,what="character") to read - automacally - some
html pages,
I was wondering if there was an option to "hide" my IP-adress, or to use a
"fake" one ?
I would like to chek if the website is using my IP-adress to change the
content of the page (it is the price of airline tickets actually)
I want to see if it is possible to do a
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
>
2003 Jul 15
1
dbApply (R newbee)
I am trying to use R interfaced with MySQL. Present goal is that R should
calculate the 85% quantile of AvgSpeed for each LinieID. Looking through
documentation of the RMySQL Package, I guessed that dbApply would do the
trick due to this example
## compute quanitiles for each network agent
con <- dbConnect(MySQL(), group="vitalAnalysis")
res <- dbSendQuery(con,
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
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