Displaying 20 results from an estimated 1000 matches similar to: "Reading binary files"
2013 Apr 19
1
How to read a direct access file by connecting fortran with R ?
Hello all,
I would like to read the specific line number row of a direct access file (which is stored as a n_row*n_col matrix of elements kind=p) without reading all the preceding lines (i.e 1,2,..,row-1).
Is there a function in R that can perform this task?
To solve my issue, I tried without to call Fortran from R by doing the following steps:
I) I wrote a subroutine in fortran called
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,
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
2011 Jul 20
3
Grouping columns
*Hi @ all,
I have a question concerning the possibilty of grouping the columns of a
matrix.
R groups the columns alphabetically.
What can I do to group the columns in my specifications?
The script is the following:*
> #R-Skript: Anzahl xyz
>
> #Quelldatei einlesen
> b<-read.csv2("Z:/int/xyz.csv", header=TRUE)
>
> #Teilmengen f?r die Einzeljahre generieren
>
2003 Feb 13
5
ESRI shape file import and time-space models
Dear R user,
I am running R under Windows 2000.
I am looking for a routine for importing
- shape files (ESRI) into R
- dbase files (FOXPRO) into R
and I am looking for time-space models for description and prediction of
Bernoulli-, Binomial- and Poissonvaraibles.
Thank's a lot for a reply.
Sincerely yours,
Ekkehardt Altpeter
Swiss Federal Office of Public
2002 Nov 29
2
readBin or writeBin adds extra nulls (PR#2333)
Full_Name: Ken Yap
Version: 1.6.1
OS: Linux (SuSE 8.0)
Submission from: (NULL) (129.78.64.5)
I'm trying to copy a file using readBin and writeBin. (The reason is to be able
to pipe PostScript or PDF output to a socket later, this is just an experiment.)
I do:
zz <- file("foo.ps", "rb")
r <- readBin(zz, character(), 1000000)
yy <- file("bar.ps",
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}}
+
2003 Sep 01
1
Re: [R] File Reading Problem (PR#4043)
On Mon, 1 Sep 2003 14:26:43 -0700, "Jiming Yu"
<jimingyu@princeton.edu> wrote:
>Dear all,
> I am trying to read characters byte by byte(in their ASCII codes) from a
>file
I was going to suggest using readBin, but there seems to be a bug:
> con <- file('c:/test.txt','rb')
> readBin(con,'c',15,1)
stack imbalance in internal readBin, 9
2012 May 03
2
Help with readBin
I'm trying to read a binary file created by a fortran code using readBin
and readChar. Everything reads fine (integers and strings) except for
double precision numbers, they are read as huge or very small number
(1E-250,...). I tried various endianness, swap, But nothing has worked so
far.
I also tried on R 64 bit for linux and windows (R 2.14) and R 2.11 on
windows XP 32 bit.
Any help would
2006 Jun 28
2
read file with readBin (the file was saved with a C-routine)
Hello!
I have problems with using of "readBin" to read files, which was written in C with "fwrite". In the C-File there is the following Code:
fwrite(MyitINI,sizeof(itINItype),1,outfile);
where MyitINI is a structure of the following form
typedef struct{
int KernelFileSave; /* Determined, if Systemmatrix saved or not.*/
char KernelFileName[200]; /* A-Matrix name
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
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
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
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
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
2003 Nov 14
2
writeChar potential buffer overrun (PR#5090)
Trying to copy the (binary) header of a input file directly
to an output file, I've had repeatable seg faults. The call:
writeChar(hdr, outfh, nchars=6144)
when hdr just contains one empty string seems to be the
culprit. The stack traces weren't all that illuminating,
with sig 11 in memory-related functions following this. But
in src/main/connections.c it looks like do_writechar
2010 Apr 25
4
how to make read in a vector of 0s and 1s with no space between them
Hi all,
Probably a rudimentary question. I have a flat file that looks like
this (the real one has ~10e6 elements):
10110100101001011101011
and I want to pull that into R as a vector, but with each digit being
it's own element. There are no separators between the digits. How can
I accomplish this? Thanks in advance!
Matt
--
Matthew C Keller
Asst. Professor of Psychology
University of
2006 Sep 16
2
Win2000/XP on Samba 3, Etch
I have problems configuring Win-clients with Samba 3 / Debian-Etch-Server.
Trying to connect the win-clients, the error at logon is:
no primary domain or wrong password
the server log reads:
[2006/09/15 13:34:14, 3] smbd/sesssetup.c:reply_sesssetup_and_X_spnego(691)
NativeOS=[Unix] NativeLanMan=[Samba] PrimaryDomain=[]
[2006/09/15 13:34:14, 3] libsmb/ntlmssp.c:ntlmssp_server_auth(672)
Got
2002 Apr 29
1
Garbage collection: RW1041
Have searched through the archives but have been unable to find any related
issues - hopefully I'm not bringing up an old topic.
Am using RW1041 on a Windows NT on a machine with 1Gb of memory. Have a
function doit() that reads in a chunk of data using readBin, performs a
regression, saves out coeffs and then returns. When using Rgui with the
default memory limit of 256Mb I'm able to
2008 Feb 06
1
Building R for Windows
I have some C code (using an old Borland compiler) that calls a DLL that
I'd like to get working from Windows and R (so I can read ABF files -- Axon
Binary Files -- directly in R).
I thought a good first approach would be able to build R in Windows, so
that's what I'm trying to do. [I've done test builds of R under Linux
before, and that seemed fairly simple.]
I've