Displaying 20 results from an estimated 1000 matches similar to: "slightly speeding up readChar()"
2002 Apr 26
4
Memory "leak" in readChar (PR#1483)
Full_Name: Hugh C. Pumphrey
Version: 1.4.1
OS: Linux (Debian Woody)
Submission from: (NULL) (129.215.133.170)
The function readChar() appears to have some type of problem with memory
allocation.
I don't know if "memory leak" is the correct term but if one uses readChar()
many
times, the R binary grows in size until it eats all your memory and swap space.
The code enclosed below
2007 Jun 24
2
problem gsub in the locale of CP932 and SJIS (PR#9751)
Full_Name: Ei-ji Nakama
Version: R-2.5.0
OS: any
Submission from: (NULL) (219.117.236.5)
problem by operation of gsub in the locale of CP932 and SJIS.
The inconvenient character code which used 0x5c after the first byte.
--- R-2.5.0.orig/src/main/character.c 2007-04-03 11:05:05.000000000 +0900
+++ R-2.5.0/src/main/character.c 2007-06-24 22:31:06.000000000 +0900
@@ -986,6 +986,17 @@
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:
2024 Jan 26
1
readChar() could read the whole file by default?
I am curious why readLines() has a default (n=-1L) to read the full
file while readChar() has no default for nchars= (i.e., readChar(file)
is an error). Is there a technical reason for this?
I often[1] see code like paste(readLines(f), collapse="\n") which
would be better served by readChar(), especially given issues with the
global string cache I've come across[2]. But lacking the
2024 Jan 26
1
[External] readChar() could read the whole file by default?
On Fri, 26 Jan 2024, Michael Chirico wrote:
> I am curious why readLines() has a default (n=-1L) to read the full
> file while readChar() has no default for nchars= (i.e., readChar(file)
> is an error). Is there a technical reason for this?
>
> I often[1] see code like paste(readLines(f), collapse="\n") which
> would be better served by readChar(), especially given
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"
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
2024 Jan 29
1
[External] readChar() could read the whole file by default?
My opinion is that the proposed feature would be greatly appreciated by users.
I had always wondered if I was the only one doing paste(readLines(f),
collapse="\n") all the time.
It would be great to have the proposed, more straightforward way to
read the whole file as a string: readChar("my_file.txt", -1) or even
better readChar("my_file.txt")
Thanks for your detailed
2006 Apr 27
1
Error in readChar(): invalid UTF-8 input
I have R code to read a binary header file, consisting of several
readBin() and readChar() statements. I am currently using version R-2.2.1
(on x86_64, RH EL4) and have received the following error
Error in readChar(fid, n = 1) : invalid UTF-8 input in readChar()
This is strange because (a) I was able to read in this file successfully
in previous versions of R (circa 2005) and (b) it
2010 Jun 19
1
more powerful iconv
R community,
As you may know, R's iconv doesn't work well converting to and from
encodings that allow embedded nulls. For example
> iconv("foo", to="UTF-16")
Error in iconv("foo", to = "UTF-16") :
embedded nul in string: '\xff\xfef\0o\0o\0'
However, I don't believe embedded nulls are at issue here, but rather
that R's iconv
2012 Apr 01
1
scan() vs readChar() speed
Dear list,
I am trying to find a fast solution to read moderately large (1 -- 10
million entries) text files containing only tab-delimited numeric
values. My test file is the following,
nr <- 1000
nc <- 5000
m <- matrix(round(rnorm(nr*nc),3),nr=nr)
write.table(m, file = "a.txt", append=FALSE,
row.names = FALSE, col.names = FALSE)
scan() is faster than
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
2009 Sep 26
1
Problem with downloading workspace file from a web address
Dear All,
To load a previously saved workspace, one can do the following:
load("/path/to/the/saved/workspace/file")
However, if the path to the saved workspace file is a web address, one
gets the following error:
?Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file
2012 Sep 12
1
unzipping with ff
I've noticed that ff uses the unzip utility available on it's host OS to
load datasets via ffload. It seems to work fine in linux, but when I try
to use the package in Windows (hence dling Windows unzip utils) I get 2
errors, one telling me that the options aren't being passed to unzip
correctly and another indicating that my filename is incorrect. First,
does anyone know of an unzip
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
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.
2010 May 05
1
handling nulls while reading mainframe file
Hi,
I am trying to read in records from an old main frame file. Each record is
640 bytes. I had some success using the following statement:
iconv(readChar(con, nchars=640, useBytes =
TRUE),from="IBM037",to="",sub="#")
What I have found, however, is that ocassionally a record will contain a
Null halfway through, which causes readChar() not to read the rest of the
2010 Apr 27
4
Patch sensible callback framework
This patch adds a simple callback framework.
Modified loadfile and floadfile to look for callbacks and call them if present
Supports multiple callbacks
Modified com32/modules/linux.c to demonstrate functionality (it's a little more complicated than it should be just to demonstrate multiple callbacks). Add progress argument to display a percentage indicator when loading.
Example
boot:
2018 May 29
0
Buffering in R 3.5 connections causes incorrect data in readChar
On 05/26/2018 05:15 AM, Aaron Goodman wrote:
> 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
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