Displaying 11 results from an estimated 11 matches for "lang4".
Did you mean:
lang
2009 Oct 29
2
Help with lang4
Hi
I seem to have run into a situation where I have more than 3 arguments to
pass to a function from C.
the following functions help me build an expression for evaluation:
lang
lang2
lang3
lang4
What should one do if there are more arguments than lang4 can handle?
Regards
Abhijit Bera
[[alternative HTML version deleted]]
2011 Jan 11
1
as.environment.list provides inconsistent results under torture
...gt;
# not good
> as.environment( a )
Erreur dans length(x) : 'x' est manquant
# not good either
> as.environment( a )
Erreur dans list(NULL, list(aa = function (n, mean = 0, sd = 1) :
correspondance partielle de cha?nes de caract?res incorrecte
Is it because the call made by lang4 is not protected while evaluated in
this line :
case VECSXP: {
/* implement as.environment.list() {isObject(.) is false for a list} */
return(eval(lang4(install("list2env"), arg,
/*envir = */R_NilValue, /* parent = */R_EmptyEnv),
rho));
}
(BTW, this was detected...
2009 Sep 16
2
I want to get a reference to this time series object
...ring("fPortfolio")));
R_tryEval(e, R_GlobalEnv, NULL);
UNPROTECT(1);
// creating a default portfolioSpec object
PROTECT(e=lang1(install("portfolioSpec")));
PROTECT(portSpec=R_tryEval(e,R_GlobalEnv, NULL));
// creating a portfolioData object
PROTECT(e=lang4(install("c"),mkString("SBI"),mkString("SPI"),mkString("SII")));
PROTECT(c=R_tryEval(e,R_GlobalEnv,NULL));
PROTECT(e=lang3(install("["),install("SWX.RET"),c));
PROTECT(portData=R_tryEval(e,R_GlobalEnv,NULL));
PROTECT(e=lan...
2009 Sep 29
3
How do I access class slots from C?
...ring("fPortfolio")));
R_tryEval(e, R_GlobalEnv, NULL);
UNPROTECT(1);
// creating a default portfolioSpec object
PROTECT(e=lang1(install("portfolioSpec")));
PROTECT(portSpec=R_tryEval(e,R_GlobalEnv, NULL));
// creating a portfolioData object
PROTECT(e=lang4(install("c"),mkString("SBI"),mkString("SPI"),mkString("SII")));
PROTECT(tsAssets=R_tryEval(e,R_GlobalEnv,NULL));
PROTECT(e=lang4(install("["),install("SWX.RET"),R_MissingArg,tsAssets));
PROTECT(tsReturns=R_tryEval(e,R_GlobalEn...
2007 Aug 16
0
call R function in c++ program
...ECT( e2 = R_ParseVector(e1, 1, &status, R_NilValue) );
R_tryEval(VECTOR_ELT(e2,0), rho, &hadError);
UNPROTECT(2);
// for execute "simple" function (without parser)
PROTECT( e1 = lang3(install(":"), ScalarInteger(1), ScalarInteger(4))
);
PROTECT( e2 = lang4(install("matrix"), e1, ScalarInteger(4),
ScalarInteger(1)) );
PROTECT( e3 = lang2(install("layout"), e2) );
eval(e3,R_GlobalEnv);
UNPROTECT(3);
// for call library (using parser)
PROTECT( e1 = mkString("library(ade4, logical.return=TRUE);
PROTECT(...
2001 Dec 13
3
R-1.4.0: how to use getSymbolInfo()?
I have a package that solves systems of ordinary differential equations
coded as an R function (odesolve, on CRAN). The function is passed to R
code, and c and Fortran code called by it uses lang4() and eval() to
evaluate the R function inside a compiled c function to use in a
compiled ODE solver. This works quite well, but can be slow.
I'd like to be able to supply the name of a compiled function,
dynamically loaded into the current session, and pass either the name of
the function or...
1999 Sep 17
1
lambda error update
Two more details:
Someone else who works here, and hasn't used 0.65.0, thinks he's seen the
error before. He restarted R, and it went away.
Second, I think the relevant code is in
SEXP do_function, in eval.c in the main directory.
line 695: WrongArgCount("lambda")
Beyond that I'm afraid I'm getting in over my head.
Matt
2014 Apr 03
1
question regarding lang2 command in C
Hi ,
I am asking too many questions , sorry for that . I am creating a data
frame in C itself , reading a table .
The data frame calling code looks like this
======================================
*PROTECT(dfm=lang2(install("data.frame"),df));*
*SEXP res = PROTECT(eval(dfm,R_GlobalEnv));*
UNPROTECT(2);
return res;
==================================
It works fine , now the problem
1999 Sep 18
1
lambda error update (PR#282)
Matthew Wiener <mcw@ln.nimh.nih.gov> writes:
> > parameters (xxdefun in gram.y calls lang4). The arg count got changed
> > from 0.64.2 to 0.65.0 (from 3 to 4) to accommodate the stored source
> > attribute. I suppose that a function stored in a saved workspace might
> > cause some kind of mess when restored.
> >
>
> If I understand this correctly, it would...
2011 Jan 11
0
[Rcpp-devel] Loading a package using Rcpp Modules results in memory corruption
...function do_as_environment(), case VECSXP of
the
switch. Here is modified code that seems to fix the problem, at least under
Linux:
case VECSXP: {
Rprintf("VECSXP as.environment\n");
/* implement as.environment.list() {isObject(.) is false for a list} */
SEXP sp = PROTECT(lang4(install("list2env"), arg,
/*envir = */R_NilValue, /* parent = */R_EmptyEnv));
SEXP res = eval(sp, rho);
UNPROTECT(1);
return res;
}
Dominick
> Romain
>
>
> --
> Romain Francois
> Professional R Enthusiast
> +33(0) 6 28 91 30 30
>...
2010 Mar 05
2
Writing own simulation function in C
I am wishing to write my own random distribution simulation function using C
programmin language(for speed) via R. I am familiar with R programming but
somewhat new to C programming. I was trying to understand "Writing R
extensions" -guide and its part 6.16, but I found it hard to
understand(http://cran.r-project.org/doc/manuals/R-exts.html#Standalone-Mathlib).
I also tried to get