Displaying 20 results from an estimated 9000 matches similar to: "Enhancement request: anonymous connections"
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
2005 Nov 03
3
Search within a file
Hi,
I am looking for a way to search a file for position of some expression,
from within R. My current code:
sha1Pos = gregexpr("<sha1>", readChar(filename,
file.info(filename)$size))[[1]]
Works fine for small files, but text files I will be working with might get
up to Gb range, so I was trying to accomplish the same without loading the
whole file into R.
I realize this is
2017 Sep 12
3
Load R data files
Dear All:
I am trying to load an R data set, but I got the following message. Please
see below. The file is there.
setwd("F:/Fall_2017/5-STA574/2-Notes/1-R/1-R_new/chapter4-Entering_Data")
datahs0csv <- read.table("hs0.csv", header=T, sep=",")
attach(datahs0csv)
detach(datahs0csv)
rm(list=ls())
Then I tried to reload the data, but I got this error message. I
2017 Sep 12
2
Load R data files
Dear All:
It was saved, but there was a space somewhere. So it works for me now.
I do have another similar problem.
I saved an R data file
save(datahs0csv,file="
F:\Fall_2017\5-STA574\2-Notes\1-R\1-R_new\chapter4-Entering_Data/datahs0csv2
.rda")
*The new R data file "*datahs0csv2.rda*" is in the directory.*
I tried to load the file "" to R, but I got an error
2009 Jul 21
1
Checking on closed file connections
Hi! I'm wondering if there's a smart way around this:
fileName= (some valid file on your system)
> fileCon=file(fileName, open="rt")
> l<-readLines (fileCon, n= 1)
>
> isOpen(fileCon)
[1] TRUE
> close(fileCon)
> isOpen(fileCon)
Error in isOpen(fileCon) : invalid connection
How do you test for a file being closed if isOpen gives you an error
2006 Jun 02
1
Typo fix for readBin.Rd
Hi,
The man page for readBin has a small typo:
--- a/src/library/base/man/readBin.Rd
+++ b/src/library/base/man/readBin.Rd
@@ -58,7 +58,7 @@ writeBin(object, con, size = NA, endian
\code{readBin} and \code{writeBin} read and write C-style
zero-terminated character strings. Input strings are limited to 10000
- characters. \code{\link{readChar}} and \code{\code{writeChar}}
+
2017 Sep 12
0
Load R data files
Hi Abou,
You haven't saved the datahs0csv.
When you are done manipulating datahs0csv you can use save(datahs0csv, file
= 'datahs0csv.rda'). Then you should be able to load the data.
HTH
Ulrik
On Tue, 12 Sep 2017, 20:46 AbouEl-Makarim Aboueissa <
abouelmakarim1962 at gmail.com> wrote:
> Dear All:
>
> I am trying to load an R data set, but I got the following message.
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
2018 May 26
2
Buffering in R 3.5 connections causes incorrect data in readChar
I noticed an issue where readChar does not return the correct value after a
call to readline. It appears that readChar is not aware of the buffering,
so it reads from the end of the buffer, rather than the current position in
the file. This is a significant change of behavior from R-3.4.4.
Below is a test case that I used to home in on the problem.
---
p<-"test2.txt"
2017 Sep 12
0
Load R data files
The object you load has the same name as the object you saved. In this case
datahs0csv and not the name of the file sans .rda
On Di., 12. Sep. 2017, 21:26 AbouEl-Makarim Aboueissa <
abouelmakarim1962 at gmail.com> wrote:
> Dear All:
>
>
> It was saved, but there was a space somewhere. So it works for me now.
>
> I do have another similar problem.
>
> I saved an R
2003 Nov 06
2
Summary: How to represent pure linefeeds chr(10) under R for Windows
Thanks to all who have responded.
My concern was to be able to write a csv file that can have line feeds in
string columns chr(10).
Why? Excel allows line feeds chr(10) within cells and line breaks
chr(13)+chr(10) at line ending,
but the windows version of R automatically replaces \n by \r\n in writing
and \r\n by \n in reading (text mode).
The clues for a solution came from Brian Ripley and
2018 May 29
1
Buffering in R 3.5 connections causes incorrect data in readChar
Tomas,
Thank you for the explanation. I see in the documentation: "These functions
are intended to be used with binary-mode connections." So I see how using
it on a text connection is undefined, and not a bug. An error or warning
when attempting to use a it on a text connection would be helpful
considering how the behavior has changed in R-3.5.
On Tue, May 29, 2018 at 3:09 AM, Tomas
2000 Dec 20
1
unlink() is not synchronized with existing connections (PR#783)
> # creating a file
> cat("sddfasdf", file="tempfile")
> showConnections()
class description mode text isopen can read can write
> con <- file("tempfile", "r")
> readLines(con)
[1] "sddfasdf"
Warning message:
incomplete final line in: readLines(con, n, ok)
> showConnections()
class description mode text isopen
2009 May 21
3
file descriptor leak in getSrcLines in R 2.10.0 svn 48590
I noticed the following file descriptor leak when I couldn't remove
a package unless I shut down the R session that had loaded and
used it. The function that triggered the problem printed the output
of a call to parse(). Each time one prints a srcref a connection is
opened and not closed. It looks like it happens in
as.character.srcref's
call to getSrcLines, which has some logic I
2014 Jun 19
1
isOpen() misbehaviour
Hello,
>From the doc, it says:
"isOpen returns a logical value, whether the connection is currently open."
But actually it seems to die on closed connections:
> con <- file()
> isOpen(con)
[1] TRUE
> close(con)
> isOpen(con)
Error in isOpen(con) : invalid connection
Is it expected ?
Tested on R-3.0.2 and R version 3.1.0 Patched (2014-06-11 r65921) on
linux x86_64
2016 Nov 13
1
Memory leak with tons of closed connections
Using dup() before fdopen() (and calling fclose() on the connection
when it is closed) indeed fixes the memory leak.
FYI,
Gabor
Index: src/main/connections.c
===================================================================
--- src/main/connections.c (revision 71653)
+++ src/main/connections.c (working copy)
@@ -576,7 +576,7 @@
fp = R_fopen(name, con->mode);
} else { /* use
2006 Nov 07
1
reading VERY large binary files
Hello,
I am trying to read in elements out of a very large binary file ... the
total file is 4 gigs. I want to select rows out of the file, and the
current procedure I run works but is prohibitively slow (takes more than
a day to run and still won't complete). Is there any faster way to
accomplish this?
My current procedure looks like this:
readHH <- function(file_name,
2005 Feb 01
2
assign connections automatically
Hi all,
I am trying to create a function that will open connections to all
files of
one type within the working directory.
I've got the function to open the connections, but I am having a
bugger of a
time trying to get these connections named as objects in the workspace.
I am at the point where I can do it outside of the function, but not
inside, using assign. I'm sure I'm
2007 Jun 14
1
Clarification for readChar man page
Hi,
Here's a patch to the readChar manual page (R-trunk as of today) that
better clarifies readChar's return value. It could use some work as I'd
also like to add some text about using nchar() to find the length of the
string that readchar() returns, but I'm unsure which of type="bytes" or
type="chars" to mention. Is it type="chars"?
Index:
2006 Mar 25
2
R gets slow
Hello, I have R as a socket server that computes R code sent by some
scripts (the clients). These scrips send R code to generate models
(SVM). The problem is that first models are generated in less than one
second and one hour later, the same models are generated in more than
ten seconds (even training with same data). If I restart the server ,
then it works well (fast). I don't know if I have