Displaying 20 results from an estimated 200 matches similar to: "passing "..." arguments to a function called by eval()"
2003 Nov 03
2
lang2(...) with two and more arguments
Dear R-help,
how could I create an R call in C code using lang2 with 2 and more
arguments? I tried this code:
SEXP f(SEXP fn, SEXP rho)
{
SEXP R_fcall, x, y;
PROTECT(R_fcall = lang2(fn, R_NilValue));
PROTECT(x = allocVector(REALSXP, 1));
PROTECT(y = allocVector(REALSXP, 1));
REAL(x)[0] = 10;
REAL(y)[0] = 20;
SETCADR(R_fcall, x);
SETCADR(R_fcall, y);
2008 Apr 24
1
Calling R functions with multiple arguments from C
Hi,
I'm writing a C function that has to call a R function with multiple
arguments. I've read the relevant section in Writing R Extensions, and
searched the R site, mailing lists as well as rseek. I managed to call
the function, but I'm now having trouble creating the argument list.
I tried to create a pairlist of the arguments and send it to the R
function. The R function however
2009 Sep 15
1
How can I use R:sort function in C code?
Hi, I wrote a C extension for R. Within the C code I wanted to invoke the
R's sort function, with the argument "index.return = TRUE". I found it is a
difficult problem, how can I do that? I have implemented the decreasing
sorting by the code "PROTECT(R_fcall = lang3(install("sort"), x, desc));",
but how to define the "index.return" argument?
Thanks in
2017 Jun 05
2
Usage of PROTECT_WITH_INDEX in R-exts
Hi
I've noted a minor inconsistency in the documentation: Current R-exts reads
s = PROTECT_WITH_INDEX(eval(OS->R_fcall, OS->R_env), &ipx);
but I believe it has to be
PROTECT_WITH_INDEX(s = eval(OS->R_fcall, OS->R_env), &ipx);
because PROTECT_WITH_INDEX() returns void.
Best regards
Kirill
2009 Mar 13
1
search for string insider a string
Hi, sorry if it is a too stupid question, but how do I a string search
in R:
I have a dataframe A with A$test like:
test1
bcdtestblabla2.1bla
cdtestblablabla3.88blabla
and I want to search for string that start with 'dtest' and ends with
number and return the location of that substring and the number, so the
end result would be:
NA NA
3 2.1
2 3.88
I find grep can
2006 Mar 14
7
Starting with RJS - not working
Hi,
I''m trying to work with RJS and folowed Cody Fauser''s tutorial
(http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates)
I''ve started by creating a new rails applications and executing
rake freeze_edge
rake rails:update:javascripts
rake rails:update:scripts
After that I''ve created a controller:
class DtestController < ApplicationController
2017 Jun 06
2
Usage of PROTECT_WITH_INDEX in R-exts
On 06.06.2017 10:07, Martin Maechler wrote:
>>>>>> Kirill M?ller <kirill.mueller at ivt.baug.ethz.ch>
>>>>>> on Mon, 5 Jun 2017 17:30:20 +0200 writes:
> > Hi I've noted a minor inconsistency in the documentation:
> > Current R-exts reads
>
> > s = PROTECT_WITH_INDEX(eval(OS->R_fcall, OS->R_env), &ipx);
2010 Sep 27
4
Fitting problem
Hi,
I have a function that generates a set of data but I am having problems
determining the parameters using the nls fitting procedure.
####
"MH"<-function(field,diameter,mu=10e-7,sig=0.1,Ms=100,chi=0){
#variables mu, sig, chi, Ms
#input: field and diameter
#all in CGS
rho <- 5
kb <- 1.38e-16
t <- 300
length.d<-length(diameter)
length.H<-length(field)
2017 Jun 09
1
Usage of PROTECT_WITH_INDEX in R-exts
>>>>> Kirill M?ller <kirill.mueller at ivt.baug.ethz.ch>
>>>>> on Thu, 8 Jun 2017 12:55:26 +0200 writes:
> On 06.06.2017 22:14, Kirill M?ller wrote:
>>
>>
>> On 06.06.2017 10:07, Martin Maechler wrote:
>>>>>>>> Kirill M?ller <kirill.mueller at ivt.baug.ethz.ch> on
2015 Apr 10
1
How can I have new users/groups to include posixAccount/posixGroup schema automatically?
Greetings, Rowland Penny!
>>>>>>>>> well tough, the smbldap-tools were written to do a job, map windows
>>>>>>>>> users to unix users and vice versa.
>>>>>>>> No. smbldap-tools were doing exactly the same as AD do: kept all users in one
>>>>>>>> database.
>>>>>>>>
2019 Sep 27
2
Evaluate part of an expression at C level
Hi,
I am wondering if the below is possible?
Let's assume I have the following expression:
1:10 < 5
Is there a way at the R C API level to only evaluate the 5th element (i.e 5
< 5) instead of evaluating the whole expression and then select the 5th
element in the logical vector?
Thank you
Best regards
Morgan
[[alternative HTML version deleted]]
2003 Jan 16
1
Calling R function from within C code
Dear R experts,
I'd like to call R function from within C code.
I looked through the 'R exts' manual, found examples with
lang2(R_fcall, list), and tried it, but it seemed to create
the call, which can accept only a single argument of 'list'
type, when I need to create the call of R functions with
arbitrary numbers of arguments.
How can I do it?
Thanks a lot.
--
WBR,
2008 Mar 07
1
parameters for lbfgsb (function for optimization)
Can anyone help me with lbfgsb (function for optimization)?
It takes the following parameters:
void lbfgsb (int n, int lmm, double *x, double *lower,
double *upper, int *nbd, double *Fmin, optimfn fn,
optimgr gr, int *fail, void *ex, double factr,
double pgtol, int *fncount, int *grcount,
int maxit, char *msg, int trace, int nREPORT);
What do I put for parameter ex (11th parameter)? I looked at
2011 Oct 29
0
samba 3.5.6 & win2k8 r2, session request fails
Hi
I've been trying to join a debian6 (IP: 172.16.0.180) box to a win2k8 r2 active directory (ORCHARD, IP: 172.16.0.200), without much success.
The settings for samba and kerberos are correct:
- and kinit works fine
The error string returned is: 'failed to lookup DC info for domain 'ARIAS.INT' over rpc: The network name cannot be found'
2009 Mar 17
2
sweep?
I am having a hard time understanding just what 'sweep' does. The documentation states:
Return an array obtained from an input array by sweeping out a summary statistic.
So what does it mean "weeping out a summary statistic"?
Thank you.
Kevin
2013 Apr 09
5
Error when using fitdist function in R
Hello everyone,
I was trying to do some distribution fitting with a numerical field called
Tolls. The sample size = 999 rows.
Basically I assigned the Toll data to a new variable K by doing:
k<-dtest$Toll
After that, tried to fit a gamma distribution by doing: fitG<-fitdist(k,
"gamma")
Then the following messages showed (oh and I checked for empty rows before
doing this):
2008 Feb 24
1
R-2.6.2 installation (64bit) falling over with the grid package
It's a long time since I had a problem compiling R, but I've now
encountered one with R-2.6.2 on Fedora Core 6 (64bit).
The problem arises when the installation process gets to the grid
package, the unit.c part in particular. This is the output I get:
gcc -std=gnu99 -I../../../../include -I../../../../include -I/usr/local/include -fvisibility=hidden -fpic -g -O2 -c unit.c -o unit.o
2006 Mar 13
3
problem updating mulitple divs with ajax
i''m having some issues updating multiple divs via ajax. perhaps someone can
lend some assistance.
i''ve got 2 divs:
user_list and user_form.
when a person clicks the "edit this user" or "add new user" link the
user_form div is updated via an ajax call and the form is shown in the
user_form div.
this form is a remote form. it submits to either the update
2008 Oct 20
0
New verion 0.3-7 of gsubfn package
Version 0.3-7 of the gsubfn package is available on CRAN.
Changes to the package are:
- all known bugs have been fixed.
- in gsubfn and strapply the replacement object can be a
list (or a function, formula, character string or proto
object, as before). In the case of a list, regexp matches
are looked up in the list names and the corresponding list
component used.
# Example 1 - at
2008 Oct 20
0
New verion 0.3-7 of gsubfn package
Version 0.3-7 of the gsubfn package is available on CRAN.
Changes to the package are:
- all known bugs have been fixed.
- in gsubfn and strapply the replacement object can be a
list (or a function, formula, character string or proto
object, as before). In the case of a list, regexp matches
are looked up in the list names and the corresponding list
component used.
# Example 1 - at