Displaying 8 results from an estimated 8 matches for "lang1".
Did you mean:
lang
2009 Sep 16
2
I want to get a reference to this time series object
...ouble *v;
const char *x,*y;
Rf_initEmbeddedR(argc, argv);
// loading fPortfolio
PROTECT(e = lang2(install("library"), mkString("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));...
2006 Apr 04
1
change function's formals default values
Hello,
I'm passing a user defined function into my c code. Once this function
is in my c code, I'd like to iteratively change the values associated
with the parameters defined in the function's formal list then evaluate
the function using these newly set defaults (i.e., using lang1(fn)).
My question is, how do I simply change the value associated with each
parameter in this function's formal list. I have messed around with the
SET_FORMAL function but can't figure out how to change these values.
Thanks-
Andrew
--
Research Fellow
Department of Forest Resources
Univ...
2006 Oct 22
1
Getting hold of a package's environment from C code
Hi,
I have a package where I'm calling an R function (say "foo") from C
code. "foo" is in the same package, but is not exported. I construct
the call using lang1(install("foo")), but to eval it I need the
package's environment. Is there a way to do this? Passing the correct
environment through .Call() is not an option.
Right now, I'm getting the environment first using something like
rho = PROTECT(eval(lang2(install("environment&...
2017 Nov 09
2
check does not check that package examples remove tempdir()
I think recreating tempdir() is ok in an emergency situation, but package
code
should not be removing tempdir() - it may contain important information.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Wed, Nov 8, 2017 at 4:55 PM, Henrik Bengtsson <henrik.bengtsson at gmail.com
> wrote:
> Related to this problem - from R-devel NEWS
>
2009 Sep 29
3
How do I access class slots from C?
...ouble *v;
const char *x,*y;
Rf_initEmbeddedR(argc, argv);
// loading fPortfolio
PROTECT(e = lang2(install("library"), mkString("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,...
2006 Feb 16
0
Calling R functions from C and setting function's formal list values
...n using its newly set defaults at the values to be
passed in.
This way might look is:
for(i = 0; i < iters; i++){
//proposed new values for cov.fun parameters and set them as the
function's
//default arg. values
//call the function and collect the returned matrix
PROTECT(RFnCall = lang1(CovFn));
PROTECT(fnCov = eval(RFnCall, env));
}
My question is, does this seem reasonable? And if so, how do I set the
value portion of the formal's list tags. Also, is the formal list a
LISTSXP. I have read the sections on 'Evaluating R expression from C' in
the docs. But the id...
2012 Sep 28
1
High memory needs [SOLVED]
...uge amount of
memory, SGE being miss-leaded, and thus killing them.
A solution could be to restrict the number of languages when
installing glibc-common (which provides the locale-archive file), to
have a smaller locale-archive file. This should be possible with:
$ echo "%_install_langs <lang1>:<lang2>:<lang3>" >> /etc/rpm/macros.lang
$ rpm -e glibc-common --nodeps
$ rm /usr/lib/locale/locale-archive
$ rpm -i <glibc-common.rpm>
I don't know why but we couldn't have glibc-common (2.12-1.80) taking
it into account, though. All languages were alway...
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
...TTPRead(ctx, dest, len))
@@ -115,19 +115,20 @@ static Rboolean url_open(Rconnection con)
#endif
case HTTPsh:
{
- SEXP sheaders, agentFun;
- const char *headers;
+ SEXP sagent, agentFun;
+ const char *agent;
SEXP s_makeUserAgent = install("makeUserAgent");
agentFun = PROTECT(lang1(s_makeUserAgent)); // defaults to ,TRUE
SEXP utilsNS = PROTECT(R_FindNamespace(mkString("utils")));
- sheaders = eval(agentFun, utilsNS);
+ struct urlconn *uc = con->private;
+ sagent = eval(agentFun, utilsNS);
UNPROTECT(1); /* utilsNS */
- PROTECT(sheaders);
- if(TYPEOF(sheaders)...