Re: [Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-06 Thread Simon Urbanek
On Jun 5, 2011, at 12:22 PM, oliver wrote: > On Sat, Jun 04, 2011 at 07:51:08AM -0400, Duncan Murdoch wrote: >> On 11-06-03 4:19 PM, oliver wrote: >>> On Fri, Jun 03, 2011 at 11:14:39AM -0500, Douglas Bates wrote: On Fri, Jun 3, 2011 at 5:17 AM, oliver wrote: > Hello, > > I'm i

Re: [Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-05 Thread oliver
Hello Jeff, thanks for the hints and details. I just downloaded xts-sources and hope it shows me the dark secrets of R ;) Ciao, Oliver __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-05 Thread oliver
On Sat, Jun 04, 2011 at 07:51:08AM -0400, Duncan Murdoch wrote: > On 11-06-03 4:19 PM, oliver wrote: > >On Fri, Jun 03, 2011 at 11:14:39AM -0500, Douglas Bates wrote: > >>On Fri, Jun 3, 2011 at 5:17 AM, oliver wrote: > >>>Hello, > >>> > >>>I'm implementing a package (C-extension), > >>>where one f

Re: [Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-04 Thread Jeff Ryan
Oliver, For an example of moving averages, take a look at the C source of the xts and TTR packages. The sources are browsable on R-forge. In short, REAL etc are functions to extract the data of an SEXP. They need to match the types coming in. So your C needs to check the type and branch accor

Re: [Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-04 Thread Duncan Murdoch
On 11-06-03 4:19 PM, oliver wrote: On Fri, Jun 03, 2011 at 11:14:39AM -0500, Douglas Bates wrote: On Fri, Jun 3, 2011 at 5:17 AM, oliver wrote: Hello, I'm implementing a package (C-extension), where one function gets data and a function that needs to be applied to the data. I want to apply t

Re: [Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-04 Thread oliver
On Fri, Jun 03, 2011 at 11:14:39AM -0500, Douglas Bates wrote: > On Fri, Jun 3, 2011 at 5:17 AM, oliver wrote: > > Hello, > > > > I'm implementing a package (C-extension), > > where one function gets data and a function > > that needs to be applied to the data. > > > > I want to apply the function

Re: [Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-03 Thread Douglas Bates
On Fri, Jun 3, 2011 at 5:17 AM, oliver wrote: > Hello, > > I'm implementing a package (C-extension), > where one function gets data and a function > that needs to be applied to the data. > > I want to apply the function to (parts of) > the data on the C-side. > > 1) how do I apply a function (give

[Rd] C-Side: Applying a function (given as param) to data (given as param)

2011-06-03 Thread oliver
Hello, I'm implementing a package (C-extension), where one function gets data and a function that needs to be applied to the data. I want to apply the function to (parts of) the data on the C-side. 1) how do I apply a function (given via SEXP) to data 2) how do I select parts of the data (also p