Displaying 20 results from an estimated 10000 matches similar to: "File end in binary connection"
2002 Jan 29
0
(PR#1287) seek was ignoring the `origin' argument (was
The original subject line is false. It *does* reposition, but `origin'
was being ignored, so your request was to reposition to the beginning of
the file, and that is what happened.
This was already fixed in R-patched: from NEWS there:
o seek() on file connections was ignoring the `origin' argument.
It's always worth looking at the current patched version.
On Tue, 29 Jan 2002
2001 Dec 11
1
Using lib Rstreams and gzfile()
Hi all,
in the last time I've intensively used Rstreams to read and write from
binary files. Now I'm wondering if it is possible to use Rsteams
functions with gzipped files. But I haven't found the trick:
> p1c.gzip <- gzfile("daten/p1c_all.mea.gz", open="rb")
> readBin(p1c.gzip, integer(), n=64,size=2)
[1] 84 1 400 1 749 0 0 0
2002 Jan 10
1
Closing binary file connections
Hi all,
I'm writing a function that read data from a binary file. I want to
close all opened connections, but it failed:
> showConnections()
description class mode text isopen can read can write
3 "daten/t5_all.mea" "file" "rb" "binary" "opened" "yes" "no"
4 "daten/t5_all.mea"
2001 Jun 01
1
Read to the end of a stream (package Rstreams)
Hi there,
I want to read all data from a binary file (with package Rstreams). I
tried the following function (small piece of code):
readdata <- function (file) {
# open file
s <- openstream(file, "read")
# read int values
while (s$position <= s$size) {
readint(s, 1, 2) -> type
[...]
}
return()
}
and got the following error:
> Error in
2002 Oct 07
2
Error in writeBin(object, con, size = 2)
Hi all,
I wrote a function (in R batch mode) which reads binary data,
interpolates sometimes and wrote a new binary file of the same size as
the input file. Her is a bit of code:
while (length( head <- readBin(si, integer(), 64, size=2))) {
data <- readBin(si, integer(), head[5], size=2)
## now write head to new file
writeBin(head, so, size=2)
## if head[4] is 9 or
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,
2012 Jun 19
1
seek(), skip by bits (not by bytes) in binary file
Hello,
Has a function been built that will skip to a certain bit in a binary file?
As of 2009 the answer was 'no':
http://r.789695.n4.nabble.com/read-binary-file-seek-td900847.html
https://stat.ethz.ch/pipermail/r-help/2009-May/199819.html
If you feel I don't need to (like in the links above), please provide some
help. (Note this is my first time working with binary files.)
I'm
2009 May 18
2
readBin on binary non-blocking connections (Windows & Unix differences/bugs)
R-devel:
I am encountering a consistency issue using socketConnection and
readBin with *non-blocking* connections on Unix and Windows XP (no
Vista to test).
I am a bit confused by the behavior of *non-blocking* connections
under Windows specifically. When calling readBin on a non-blocking
connection when there is no data to read on the socket, the connection
under Unix will return a vector of
2004 Jun 01
2
Importing binary data
Hi everybody!
I've a large dataset, about 2 Mio entries of the format which I would like
to import into a frame:
<integer><integer><float><string><float><string><string>
Because to the huge data amount I've choosen a binary format instead
of a text format when exporting from Matlab.
My import function is attached below. It works fine for only
2009 Feb 11
0
More help with Binary Files
Does anyone else have any insights to this issue:
Henrick, thank you for your very quick response. I've examined the readBin
help file with respect to endian and I'm still not sure I'm getting this
correct.
Here is what I'm coding:
con <- file(file.choose(), open="rb")
Year66 <- readBin(con, what=integer(), signed = TRUE, size = 2,
endian="little", n
2001 Nov 22
4
changing the magnification of axis annotation
Hi all,
how do I change the magnification of xaxis annotation? I need a smaller
axis text size in some of my plots. I tried cex.axix=0.5 in plot(), but
this doesn't work.
Thanks, Sven
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or
2009 Nov 25
3
Test Binary File
I've got an error with the way I'm using readBin on a binary file of unknown internal structure. I know the structure consists of rows and columns, but I'm not sure how many of each.
So, does anyone know of a valid test set of binary data that I could reference while trying to figure out the technique of using readBin?
It would be really helpful to try out readBin on a readily
2008 Aug 22
2
How I can read the binary file with "different type"?
Hi all,
I have a binary file which have 8*100 bytes. The structure of the file is
as follows: every eigth bytes represent 2 data:the first four bytes is the
little-endian for integer, the next four bytes is the little-endian for
floating32. The structure of the following bytes is as the same as the first
eight bytes'.
As the function readBin only read the binary file with one structure
2010 Mar 25
1
RODBC : reading binary data from a TXT field belonging to a PostgeSQL table
Dear R-List,
I am working with binary data that I want to store in a PostgreSQL
DataBase. I decided to use a TXT field. I read my binary file with
readBin function, I succeed in my data storage in the database but I
have some trouble to extract the data : the correct amount of bytes is
stored in the TXT field but when I access to the data, the extracted
dataframe is truncated !
2012 Apr 13
2
Can't read a binary file
Hi, I've read up on readBin() and chapter 6 in the R Data Import/Export manual, but I still can't read a binary file. Here is how the creator of the file described the code that would be needed in Fortran:
"Every record has a return in fortran. The length of each record is nx*ny*4. To read you would use the following:
nlayx = nx*ny*4
do iz=1,nz,4
read(binary file) var(1:nlayx)
2009 Jul 27
1
read binary file seek()
I want to read in a binary file using the readBin() function. In order to
skip uninformative parts of the file I use the seek() function, I need to
specify the number of bits to skip rather than the number of bytes to skip.
E.g. seek(to.read,origin="current",blockSize)
with blockSize giving the number of bits
Does anybody know if this works? Any help would be highly
2002 Aug 06
0
pipe and binary i/o (on Linux)
Thanks very much, Professor Ripley.
Reid Huntsinger
-----Original Message-----
From: ripley at stats.ox.ac.uk [mailto:ripley at stats.ox.ac.uk]
Sent: Tuesday, August 06, 2002 3:00 AM
To: Huntsinger, Reid
Cc: r-help at stat.math.ethz.ch
Subject: Re: [R] pipe and binary i/o (on Linux)
On Mon, 5 Aug 2002 ripley at stats.ox.ac.uk wrote:
> pipe predates readBin, and no one has seen a
2002 May 29
4
Why is.integer() doesn't work with single values?
Hi all,
I don't understand the behavior of is.integer():
> x <- integer()
> is.integer(x)
[1] TRUE
> x <- 10
> is.integer(x)
[1] FALSE
> x <- 1:10
> is.integer(x)
[1] TRUE
Why is.interger() returns FALSE if x has only one element? And how can
someone check if x is an integer but contains only one value? (R 1.5.0
on Linux i386)
Thanks, Sven
2009 Feb 11
1
Reading Binary Files
Hello
I'm encountering some difficulty correctly reading binary files. The binary
files store data as "short" rather than "double" , "int", or any of the
other modes of the vector being read.
The data represents a regular grid of size 419 rows by 264 columns, to make
it more interesting, the data are daily records, for a total of 37 years.
The file size is
2002 Jun 18
3
Maybe a problem in binary read/write (PR#1688)
Full_Name: Johnny Accot
Version: 1.5.1
OS: Linux
Submission from: (NULL) (198.4.83.52)
Hi.
I'm having a problem with the binary read/write functions. I'm writing a device
driver in R (why not?) and of course I have to send a couple commands to the
device. Typically, I send one byte, receive one acknowledgement byte, send
another byte, receive an ACK, and so on. At least this is what