Re: [Rd] dynamic lists at C level

2013-11-26 Thread Adrian Duşa
Thank you both, will then start from here. I didn't know that Rcpp could be fed with the C code, that's good to know...! Best wishes, Adrian On Tue, Nov 26, 2013 at 7:28 PM, Gábor Csárdi wrote: > On Tue, Nov 26, 2013 at 12:19 PM, Dirk Eddelbuettel wrote: > [...] >> Grep'ing through existing pac

Re: [Rd] dynamic lists at C level

2013-11-26 Thread Adrian Duşa
ue, Nov 26, 2013 at 6:43 PM, Dirk Eddelbuettel wrote: > > Hi Adrian, > > On 26 November 2013 at 18:12, Adrian Duşa wrote: > | Dear R-devel, > | > | I am trying to do something similar to dynamic length lists in R, but > | at C level. > | > | In R, that would be rathe

[Rd] dynamic lists at C level

2013-11-26 Thread Adrian Duşa
Dear R-devel, I am trying to do something similar to dynamic length lists in R, but at C level. In R, that would be rather trivial: - determine the length of the list - create the list object - store the values for each component - access value components by using "[[" At C level, for a single c

Re: [Rd] C code validation

2012-07-28 Thread Adrian Duşa
Dear Prof. Ripley, On Sat, Jul 28, 2012 at 7:54 AM, Prof Brian Ripley wrote: > [...] > See the advice in 'Writing R Extensions'. In particular, the most common > cause is the use of initialized values, so run under valgrind. > > Also check that your C code does not change any of its arguments: i

[Rd] C code validation

2012-07-27 Thread Adrian Duşa
Dear R-devel, I'm trying to validate the results from a C function, against a (trial and tested) older R function. For reasons unknown to me, the C function seems to give different result sometimes at each trial, even with the very same data. These are the relevant outputs from R: > library(QCA

Re: [Rd] debug R objects at C level

2012-06-21 Thread Adrian Duşa
On Thu, Jun 21, 2012 at 3:02 PM, Duncan Murdoch wrote: > On 12-06-21 7:38 AM, Adrian Duşa wrote: >>[...] > > You seeing the value, not a pointer, but you are using an integer format to > display a real.  You need the %f or related format. > > I would also recommend usi

[Rd] debug R objects at C level

2012-06-21 Thread Adrian Duşa
Dear R-devel, I am now at a debugging phase, and would like to inspect the (individual) values in an arbitrary R vector. It should be simple, but after hours of reading I am simply unable to find the right information. A possible C code is: ± # include # include # include SEXP

Re: [Rd] R and C pointers

2012-06-19 Thread Adrian Duşa
Oh, that was straightforward enough... Thanks very much, Simon. Adrian On Tuesday, June 19, 2012, Simon Urbanek wrote: > > On Jun 19, 2012, at 11:40 AM, Adrian Duşa wrote: > > > Dear R devel, > > > > Apologies for these (most probably trivial) questions, doing my first > > attempt to call C from

[Rd] R and C pointers

2012-06-19 Thread Adrian Duşa
Dear R devel, Apologies for these (most probably trivial) questions, doing my first attempt to call C from R (and actually learning C in the process). I need to pass a matrix to C, and after reading R-exts.pdf (many times), I was unable to find how to handle matrices at C-level... except for, wha