Displaying 20 results from an estimated 10000 matches similar to: "R 2.7.0, match() and strings containing \0 - bug?"
2008 May 21
1
rawToChar(raw(0))
Hi,
right now we have (on R v2.7.0 patched (2008-04-23 r45466)) that:
> rawToChar(raw(0))
[1] ""
> rawToChar(raw(0), multiple=TRUE)
character(0)
Is this intended or should both return character(0)? Personally, I
would prefer that an empty input vector returns an empty output
vector. Same should then apply to charToRaw(), but right now we get:
> x <- character(0)
>
2013 May 08
1
getting corrupted data when using readBin() after seek() on a gzfile connection
Hi,
I'm running into more issues when reading data from a gzfile connection.
If I read the data sequentially with successive calls to readBin(), the
data I get looks ok. But if I call seek() between the successive calls
to readBin(), I get corrupted data.
Here is a (hopefully) reproducible example. See my sessionInfo() at the
end (I'm not on Windows, where, according to the man page,
2007 Aug 31
1
Consistency of serialize(): please enlighten me
Hi,
I am puzzled with serialize(). It comes down generating identical
hash codes for (apparently) identical objects using digest::digest(),
which in turn relies on serialize(). Here is an example illustration
the issue:
ser <- function(object, ...) {
list(
names = names(object),
namesRaw = charToRaw(names(object)),
ser = serialize(names(object), connection=NULL, ascii=FALSE)
2007 Aug 07
2
Embedded nuls in strings
Hi,
?rawToChar
'rawToChar' converts raw bytes either to a single character string
or a character vector of single bytes. (Note that a single
character string could contain embedded nuls.)
Allowing embedded nuls in a string might be an interesting experiment but it
seems to cause some troubles to most of the string manipulation functions.
A string with an embedded 0:
2017 Oct 20
1
Another issue with Sys.timezone
>>>>> Stephen Berman <stephen.berman at gmx.net>
>>>>> on Thu, 19 Oct 2017 17:12:50 +0200 writes:
> On Wed, 18 Oct 2017 18:09:41 +0200 Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>>>>>>> Martin Maechler <maechler at stat.math.ethz.ch>
>>>>>>> on Mon, 16 Oct 2017 19:13:31 +0200
2012 Jul 20
1
subRaw?
Hello, All:
Do you know of any capability to substitute more then one byte in
an object of class Raw?
Consider the following:
> let4 <- paste(letters[1:4], collapse='')
> (let4Raw <- charToRaw(let4))
[1] 61 62 63 64
> (let. <- sub('bc', '--', let4Raw))
[1] "61" "62" "63" "64"
> # no
2017 Oct 14
2
Another issue with Sys.timezone
(I reported the test failure mentioned below to R-help but was advised
that this list is the right one to address the issue; in the meantime I
investigated the matter somewhat more closely, including searching
recent R-devel postings, since I haven't been following this list.)
Last May there were two reports here of problems with Sys.timezone, one
where the zoneinfo directory is in a
2013 May 03
1
untar() error
Dear List,
I have a list of 600+ *.gz files that I would like to extract and read the
geotiffs contained within them. I tried using the untar() function to
simplify this task but I am stumped by an error. I've combed the Internet
for a solution without luck. The details are below, and any help in solving
this matter is appreciated.
> files = list.files(path = "J:/GIMMS/NDVI",
2007 Feb 16
0
R_decompress1 and zlib
Dear all,
I have a problem similar to what was already posted about two years ago
(http://tolstoy.newcastle.edu.au/R/help/05/01/10011.html): I have a binary
file, which contains a header and data compressed by zlib and written to
the file as unsigned character. Here is, what I try to do:
> zz <- file(in.file, 'rb')
> ## the header has to be read in three parts due to the
2017 Oct 18
2
Another issue with Sys.timezone
>>>>> Martin Maechler <maechler at stat.math.ethz.ch>
>>>>> on Mon, 16 Oct 2017 19:13:31 +0200 writes:
>>>>> Stephen Berman <stephen.berman at gmx.net>
>>>>> on Sun, 15 Oct 2017 01:53:12 +0200 writes:
> > (I reported the test failure mentioned below to R-help but was advised
> > that this list is
2010 Jan 14
1
memDecompress and zlib compressed base64 encoded string
Hi,
I have zlib compressed strings (example is attached) and would like to
decompress them using memDecompress ...
I try this:
> connection <- file("compressed.txt","r")
> compressed <- readLines(connection)
> memDecompress(as.raw(compressed),type="g")
Error in memDecompress(as.raw(compressed), type = "g") :
internal error -3 in
2016 Sep 05
2
How to print UTF-8 encoded strings from a C routine to R's output?
Dear R experts,
It seems that Rprintf has to be used to print from a C routine to guarantee
to write to R?s output according to
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Printing.
However if a string is UTF-8 encoded, non-ASCII characters (e.g., the
infinity symbol http://www.fileformat.info/info/unicode/char/221e/index.htm)
are misprinted.
Is this an unsupported feature or is
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 <-
2009 May 10
2
In C, a fast way to slice a vector?
Hello,
Suppose in the following code,
PROTECT(sr = R_tryEval( .... ))
sr is a RAWSXP vector. I wish to return another RAWSXP starting at
position 13 onwards (base=0).
I could create another RAWSXP of the correct length and then memcpy
the required bytes and length to this new one.
However is there a more efficient method?
Regards
Saptarshi Guha
2009 Aug 11
1
readBin() arg check has unnecessary overhead (patch included)
Dear all,
The version of readBin() in R-devel includes a use of match(), through
`%in%`, which can affect its performance significantly. By using
primitives instead of the rather expensive call to match(), I reduce
the time spent inside readBin() by more than 30% in some of my code
(part of the tractor.base package). A simple patch that does this is
given below. This passes "make
2013 Jul 15
2
Serialize data.frame to database
Dear R-Users,
I need a very fast and reliable database solution so I try to serialize a data.frame (to binary data) and to store this data to an SQLite database.
This is what I tried to do:
library(RSQLite)
con <- dbDriver("SQLite")
db <- dbConnect(con, "test")
dbSendQuery(db, 'CREATE TABLE frames("simID" INT, "data" BLOB)')
data.bin <-
2007 Jan 26
1
readBin is much slower for raw input than for a file
Dear all,
I'm trying to write an efficient binary file reader for a file type
that is made up of several fields of variable length, and so requires
many small reads. Doing this on the file directly using a sequence of
readBin() calls is a bit too slow for my needs, so I tried buffering
the file into a raw vector and reading from that ("loc" is the
equivalent of the file pointer):
2007 Jan 26
1
readBin is much slower for raw input than for a file
Dear all,
I'm trying to write an efficient binary file reader for a file type
that is made up of several fields of variable length, and so requires
many small reads. Doing this on the file directly using a sequence of
readBin() calls is a bit too slow for my needs, so I tried buffering
the file into a raw vector and reading from that ("loc" is the
equivalent of the file pointer):
2010 Dec 14
1
Installing R-packages in Windows
Hi there,
I have the following problem and I hope somebody might help me.
First of all: I am using WinXP SP3 (english and/or german) with R in
Version 2.10.0.
Now I am trying to install some packages but unfortunately I am getting
a weird error. No matter which package I am trying to install - I nearly
get the same error.
It looks like this:
2012 Sep 19
2
Rcmd check problem
Hi, all.
I was trying to build my R package with R 2.15.1 32bit and win7.
I basically follow the routine in Steven Mosher's blog
http://stevemosher.wordpress.com/step-10-build/
After I fixed the path, and built the skeleton of the package, I started
command prompt and used the following commands in building my package
Rcmd check myPackageName
Rcmd build myPackageName
Rcmd check