Re: [Rd] using R as SHELL in gnu make

2011-09-20 Thread Paul Gilbert
Other than the RServe part, I do this all the time. It works well. Perhaps we can put together some notes off-line and then bring it back to the list. Paul -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-bounces@r- project.org] On Behalf Of Cook, Malcolm Sent:

[Rd] The boot Package with bca Intervals and Inf and NaN Values in an Automated Function [mediation()]

2011-09-20 Thread Ken Kelley
Hi everyone, I use the boot package within the MBESS package to automate much of the hard part for folks interested in performing a (simple) mediation model. The function mediation() works well, except for a (probably) unrealistic artificial data set. When I apply the bootstrap I sometimes get:

[Rd] Is it possible to pass a function argument from R to compiled code in C?

2011-09-20 Thread Alireza Mahani
I have a function in R that takes another function as argument: f - function(g, ...) { #g is expected to be a function } I want to see if there is a way to implement f in C and calling it from R using .C interface. I know that I can use function pointers for my C implementation, but I imagine

Re: [Rd] Is it possible to pass a function argument from R to compiled code in C?

2011-09-20 Thread Uwe Ligges
You can evaluate R functions from C, see Writing R Extension. Uwe Ligges On 20.09.2011 19:26, Alireza Mahani wrote: I have a function in R that takes another function as argument: f- function(g, ...) { #g is expected to be a function } I want to see if there is a way to implement f in C and

Re: [Rd] Is it possible to pass a function argument from R to compiled code in C?

2011-09-20 Thread Gabriel Becker
2011/9/20 Uwe Ligges lig...@statistik.tu-dortmund.de You can evaluate R functions from C, see Writing R Extension. Yes, I think they create a baby lapply function implemented in C (Which obviously involves evaluating a function). Also, just fyi, you want the .Call interface, not the .C

Re: [Rd] Is it possible to pass a function argument from R to compiled code in C?

2011-09-20 Thread Alireza Mahani
OK, thanks. But there are two issues with using .Call: 1- I may give up performance if I am literally running R code inside C, right? In some ways, wouldn't it defy the purpose of calling a compiled code if I end up back in R? 2- If I use the .Call interface, the resulting code will be tailored

Re: [Rd] Is it possible to pass a function argument from R to compiled code in C?

2011-09-20 Thread Jeffrey Ryan
You can't call R code as if it is C code. It is R, and requires that it be evaluated. How would your C know what to do with an R pointer... .Call is more efficient than .C, all the time. Check this list and experiment. That said, you can still call just C within the .Call R function, it

Re: [Rd] Is it possible to pass a function argument from R to compiled code in C?

2011-09-20 Thread Dirk Eddelbuettel
On 20 September 2011 at 10:26, Alireza Mahani wrote: | I have a function in R that takes another function as argument: | | f - function(g, ...) { #g is expected to be a function | } | | I want to see if there is a way to implement f in C and calling it from R | using .C interface. I know that I

[Rd] difficulty with 'parallel' in building r57032 -- missing Makefile?

2011-09-20 Thread Ben Bolker
From SVN revision 57032, with configuration R is now configured for i686-pc-linux-gnu Source directory: . Installation directory:/usr/local C compiler:gcc -std=gnu99 -g -O2 Fortran 77 compiler: gfortran -g -O2 C++ compiler: g++ -g

Re: [Rd] difficulty with 'parallel' in building r57032 -- missing Makefile?

2011-09-20 Thread peter dalgaard
On Sep 20, 2011, at 20:57 , Ben Bolker wrote: From SVN revision 57032, with configuration R is now configured for i686-pc-linux-gnu Source directory: . Installation directory:/usr/local C compiler:gcc -std=gnu99 -g -O2 Fortran 77 compiler:

Re: [Rd] difficulty with 'parallel' in building r57032 -- missing Makefile?

2011-09-20 Thread Ben Bolker
On 11-09-20 09:29 PM, peter dalgaard wrote: On Sep 20, 2011, at 20:57 , Ben Bolker wrote: From SVN revision 57032, with configuration R is now configured for i686-pc-linux-gnu Source directory: . Installation directory:/usr/local C compiler:gcc

[Rd] load.R patch suggestion

2011-09-20 Thread Ben Bolker
Inspired by http://stackoverflow.com/questions/7487778/could-you-tell-me-what-this-error-means I wrote the following very small (one-line) patch which returns an *informative* error message when R tries to load a zero-byte file rather than Error in if (!grepl(RD[AX]2\n, magic)) { : argument is