search for: parsevector

Displaying 9 results from an estimated 9 matches for "parsevector".

Did you mean: sparsevector
2019 Dec 14
2
Inconsistent behavior for the C AP's R_ParseVector() ?
...not yet during parsing. >> > > Thanks Tomas. > > I guess this has do with R expressions being lazily evaluated, and names > of arguments in a call are also part of the expression. Now the puzzling > part is why is that at all part of the parsing: I would have expected > R_ParseVector() to be restricted to parsing... Now it feels like > R_ParseVector() is performing parsing, and a first level of evalution for > expressions that "should never work" (the empty name). > > Think of it as an exception in say Python. Some failures during parsing > result in an...
2019 Dec 14
1
Inconsistent behavior for the C AP's R_ParseVector() ?
...context", or initial context, the code should from ? Searching for "context" in the R-exts manual does not return much. Best, Laurent Le sam. 14 d?c. 2019 ? 12:20, Simon Urbanek <simon.urbanek at r-project.org> a ?crit : > Laurent, > > the main point here is that ParseVector() just like any other R API has to > be called in a correct context since it can raise errors so the issue was > that your C code has a bug of not setting R correctly (my guess would be > your'e not creating the initial context necessary in embedded R). There are > many different er...
2019 Dec 14
0
Inconsistent behavior for the C AP's R_ParseVector() ?
Laurent, the main point here is that ParseVector() just like any other R API has to be called in a correct context since it can raise errors so the issue was that your C code has a bug of not setting R correctly (my guess would be your'e not creating the initial context necessary in embedded R). There are many different errors, your is just o...
2019 Dec 07
2
Inconsistent behavior for the C AP's R_ParseVector() ?
...ying to have a zero-length variable name in an environment. The surprising bit is then "why is this happening during parsing" (that is why are variables assigned to an environment) ? We are otherwise aware that the error is not occurring in the R console, but can be traced to a call to R_ParseVector() in R's C API:( https://github.com/rpy2/rpy2/blob/master/rpy2/rinterface_lib/_rinterface_capi.py#L509 ). Our specific setup is calling an embedded R from Python, using the cffi library. An error on end was the first possibility considered, but the puzzling specificity of the error (as shown b...
2019 Dec 09
3
Inconsistent behavior for the C AP's R_ParseVector() ?
...able inside list(), even > though not yet during parsing. > Thanks Tomas. I guess this has do with R expressions being lazily evaluated, and names of arguments in a call are also part of the expression. Now the puzzling part is why is that at all part of the parsing: I would have expected R_ParseVector() to be restricted to parsing... Now it feels like R_ParseVector() is performing parsing, and a first level of evalution for expressions that "should never work" (the empty name). There is probably some error in how the external code is handling R errors > (Fatal error: unable to init...
2019 Dec 09
0
Inconsistent behavior for the C AP's R_ParseVector() ?
...ould eventually become a name of a local variable inside list(), even though not yet during parsing. There is probably some error in how the external code is handling R errors? (Fatal error: unable to initialize the JIT, stack smashing, etc) and possibly also how R is initialized before calling ParseVector. Probably you would get the same problem when running say "stop('myerror')". Please note R errors are implemented as long-jumps, so care has to be taken when calling into R, Writing R Extensions has more details (and section 8 specifically about embedding R). This is unlike p...
2019 Dec 09
0
Inconsistent behavior for the C AP's R_ParseVector() ?
...during > parsing. > > > Thanks Tomas. > > I guess this has do with R expressions being lazily evaluated, and > names of arguments in a call are also part of the expression. Now the > puzzling part is why is that at all part of the parsing: I would have > expected R_ParseVector() to be restricted to parsing... Now it feels > like R_ParseVector() is performing parsing, and a first level of > evalution for expressions that "should never work" (the empty name). Think of it as an exception in say Python. Some failures during parsing result in an exception (...
2010 Jan 07
1
Segfault in GetNewPage, memory.c.
..."require(quantmod)") We're simply trying to evaluate the "require(quantmod)" string in R. > let eval_string s = eval_langsxp (parse_sexp s) eval_string calls > external parse_sexp : string -> sexp = "parse_sexp" which access the C glue code wrapping R_ParseVector. > CAMLprim value parse_sexp (value s) { > CAMLparam1(s); > SEXP text ; > SEXP pr ; > ParseStatus status; > PROTECT(text = mkString(String_val(s))); > PROTECT(pr=R_ParseVector(text, 1, &status, R_NilValue)); > UNPROTECT(2); > switch (status) { >...
2009 Sep 29
3
How do I access class slots from C?
Hi I'm trying to implement something similar to the following R snippet using C. I seem to have hit the wall on accessing class slots using C. library(fPortfolio) lppData <- 100 * LPP2005.RET[, 1:6] ewSpec <- portfolioSpec() nAssets <- ncol(lppData) setWeights(ewSpec) <- rep(1/nAssets, times = nAssets) ewPortfolio <- feasiblePortfolio( data = lppData, spec = ewSpec,