similar to: reading 2-byte integers using readBin and connections

Displaying 20 results from an estimated 2000 matches similar to: "reading 2-byte integers using readBin and connections"

2002 Aug 26
5
updating n within for(i in 1:n) loop
Hi folks: I think I'm having problems with figuring this one out: test1 <- function() { n <- 2 for(i in 1:n) { cat(paste("i =", i, "\n")); flush.console() n <- 5 # version 1 #n <<- 5 # version 2 #assign("n", 5, envir = environment(test1)) # version 3 } } I need the for(.) loop to run (say) n=5 times within the
2001 Nov 28
2
shell()/system() question
Hi folks: How do I get shell() or system() to run external programs in a particular directory (different from the current R working directory)? > version _ platform i386-pc-mingw32 arch x86 os Win32 system x86, Win32 status major 1 minor 3.0 year 2001 month 06
2003 Jan 29
1
dyn.load warning message in R1.6.2 on Windows XP
Hi folks: I used to load a DLL fine up until R 1.5.1. The same DLL dyn.loaded under R 1.6.2 prints the following warning message: > dyn.load("C:/Rajiv/Bin/rpdate.dll") Warning message: DLL attempted to change FPU control word from 8001f to 9001f > Any indication as to what the warning means, and whether I should be concerned about it? The DLL is made from a pure C code,
2004 Oct 17
2
Re: [R] Problem Compiling R-2.0.0 on Linux Alpha
Thanks, Peter, and Prof. Ripley. My efforts last night was mostly futile except that it told me about the embedded newline in Built field. Prof. Ripley: how do I get your fixes? Can I just download R-2.0.0-patched? Rajiv -------- Rajiv Prasad Scientist, Hydrology Group Pacific Northwest National Laboratory, P.O. Box 999, MSIN K9-33 Richland, WA 99352 Voice: (509) 375-2096 Fax: (509) 372-6089
2004 Oct 16
3
Problem Compiling R-2.0.0 on Linux Alpha
Hi folks: I'm trying to compile R-2.0.0 on my Alpha (164SX; alphapca56-unknown-linux-gnu) running RedHat Linux 7.2 with gcc3.4.1. Here is where the compile terminates: .... .... building package 'tcltk' mkdir -p -- ../../../library/tcltk/R mkdir -p -- ../../../library/tcltk/demo mkdir -p -- ../../../library/tcltk/exec mkdir -p -- ../../../library/tcltk/man make[4]: Entering directory
2004 Oct 16
3
Problem Compiling R-2.0.0 on Linux Alpha
Hi folks: I'm trying to compile R-2.0.0 on my Alpha (164SX; alphapca56-unknown-linux-gnu) running RedHat Linux 7.2 with gcc3.4.1. Here is where the compile terminates: .... .... building package 'tcltk' mkdir -p -- ../../../library/tcltk/R mkdir -p -- ../../../library/tcltk/demo mkdir -p -- ../../../library/tcltk/exec mkdir -p -- ../../../library/tcltk/man make[4]: Entering directory
2001 Nov 28
1
fill patterns
Hi folks: Any idea when the density and angle arguments to polygon() are to be implemented? Or is there another way to achieve hatching fill patterns? TIA. Rajiv. -------- Rajiv Prasad Postdoctoral Research Associate, Hydrology Group Pacific Northwest National Laboratory, P.O. Box 999, MSIN K9-33 Richland, WA 99352 Voice: (509) 375-2096 Fax: (509) 372-6089 Email: rajiv.prasad at pnl.gov
2001 Mar 28
1
Help: Using R from C
Hi folks: I am just beginning to try and use R from my own C programs. Platform is Windows2000, compiler Visual C++ 6.0. I built the import library R.lib from R.dll using the VC LIB.exe program. Here is a simple code I am trying to compile and run (no C++, VC++ is instructed to treat it strictly as C): #include "R.h" #include "Rinternals.h" int main(void) { int i; char
2001 May 10
3
lookup function for density(...) objects
Hi folks: Is there a lookup function that returns the variate given the cumulative probability for an object returned by the density(...) function? > mydata _ as.vector(mymatrix) > mydata.density _ density(mydata) > mydata.p80 _ lookup(mydata.density, p=0.8) # is there any function to accomplish this task? Thanks. Rajiv. -------- Rajiv Prasad, Postdoctoral Research Associate,
2002 May 01
3
upgrading to 1.5.0/uninstalling 1.4.1 on Linux
Hi folks: I have a feeling this must be a FAQ, but I did not find the answer in R Installation and Administration manual. Please point me to the right place to look for answer to this question if it's already answered. I am running 1.4.1 on an Alpha PCA56 (aka 164SX) running Redhat Linux 7.1 (kernel 2.4.19-pre4). I built 1.4.1 from sources and it is installed in /usr/local (the
2001 May 14
0
followup: lookup function for density(...) objects
Thanks to Ross Ihaka and Bob Wheeler for responding to my earlier question. I looked into the Johnson system functions in SuppDists package. For now, I want to stick with the density(...) estimator, and so still need the variate lookup function. As per Ross' suggestion, I just did a numerical integration on the density object and used approxfun/splinefun to "lookup" the variate
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
2006 Sep 27
2
Single Precision (4 byte) floats with readBin
I would like to use readBin to read a binary data file. Most of the data is 4-byte floating point but, for some reason, only double precision appears to be offered. I tried fVariable=readBin(iFile,what=single()); and got 35.87879 which looks believable except that the correct value is 3.030303. I then tried fVariable=readBin(iFile,what=single(),4); and got [1] 3.831111e+10 6.657199e+10
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):
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
2019 Nov 18
2
readBin should check that its endian argument is a legal value
I think it would be helpful if readBin checked that its endian argument is a legal value. Why? I was reviewing some of our code and noticed that the author had readBin(..., endian="network") and never having heard of "network", I looked at the man page for readBin, and it hadn't heard of "network" either. Not good. I then looked at the R code for readBin, which
2009 May 11
3
readBin: read from defined offset TO defined offset?
Hello, With the help of "seek" I can start "readBin" from any byte offset within my file that I deem appropriate. What I would like to do is to be able to define the endpoint of that read as well. Is there any solution to that already out there? Thanks for any hints, Joh
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}} +
2007 Dec 31
1
readBin differences on Windows and Linux/mac
I have been trying to use the gunzip function in the R.utils package. It opens a connection to a gzfile, uses readBin to read from that connection, and then uses writeBin to write out the raw data to a new file. This works as expected under linux/mac, but under Windows, I get: Error in readBin(inn, what= raw(0), size = 1, n=BFR.SIZE) : negative length vectors are not allowed A simple