Re: [R] Capturing output of a C executable

2014-02-04 Thread Duncan Murdoch
On 14-02-03 5:44 PM, Phil Spector wrote: Dennis - The return value from .C will almost never be useful. Are you limiting this to the specific situation Dennis described, or making a more general claim? The more general claim is clearly false. Lots of packages return useful results usi

Re: [R] Capturing output of a C executable

2014-02-03 Thread Phil Spector
Dennis - The return value from .C will almost never be useful. If you want to bring results from the C environment into R, you need to do it by passing an address to .C which will receive the result. You may find this document helpful when interfacing R to C: http://www.stat.be

Re: [R] Capturing output of a C executable

2014-02-03 Thread David Winsemius
On Feb 2, 2014, at 5:09 PM, Dennis Fisher wrote: > R 3.0.1 > OS X > > Colleagues, > > I am experimenting with incorporating C code into R. After compiling the C > code with: > R CMD SHLIB -o FILE.so FILE.c > and executing: > dyn.load(“FILE.so”) > (without any errors), I execute t

Re: [R] Capturing output of a C executable

2014-02-03 Thread William Dunlap
half > Of Dennis Fisher > Sent: Sunday, February 02, 2014 5:10 PM > To: r-h...@stat.math.ethz.ch > Subject: [R] Capturing output of a C executable > > R 3.0.1 > OS X > > Colleagues, > > I am experimenting with incorporating C code into R. After compiling the C > code wit

Re: [R] Capturing output of a C executable

2014-02-02 Thread jim holtman
?sink Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Sun, Feb 2, 2014 at 8:09 PM, Dennis Fisher wrote: > R 3.0.1 > OS X > > Colleagues, > > I am experimenting with incorporating C code into R. After com

Re: [R] Capturing output of a C executable

2014-02-02 Thread Jeff Newmiller
You really need to read the "Writing R Extensions" document. It warns you against performing I/O from C code linked to R. You probably ought to read the Posting Guide, also, since this question is off topic here --- Jeff Ne

[R] Capturing output of a C executable

2014-02-02 Thread Dennis Fisher
R 3.0.1 OS X Colleagues, I am experimenting with incorporating C code into R. After compiling the C code with: R CMD SHLIB -o FILE.so FILE.c and executing: dyn.load(“FILE.so”) (without any errors), I execute the following R functions in a terminal window: READSAS