[R] How to call time series functions from C ?

Whit Armstrong armstrong.whit at gmail.com
Thu May 7 17:21:43 CEST 2009


you have a couple of options.

If you require specific R functions to do what you want, then you will
need to call R from C.

I believe that Dirk has been working on an "RInside" package that does this.

Alternatively, you can use my tslib package, which is a general time
series library written in c++.

It's public interface in R, is the fts package, which just wraps the
c++ library to R functions.

sources are available here:
http://github.com/armstrtw/tslib/tree/master
http://github.com/armstrtw/fts/tree/master

If you want to try out tslib, feel free to contact me off list for help.

-Whit

2009/5/7 Duncan Murdoch <murdoch at stats.uwo.ca>:
> On 5/7/2009 10:55 AM, goon83 wrote:
>>
>> hi Duncan,
>>  tks for you response, it's depressed to know that i can not use time
>> series of R to finish my study.
>>  I really think R is powerfull, i used it to finish all my statistic
>> homework last year^_^.
>>  but i still wonder can i use the function of time series in the embedded
>> way of C code.
>>   Can you give me some suggestion about how to use time series of R in C
>> code?
>
> I did, in the previous message.
>
> Duncan Murdoch
>
>>    tks  --------------------
>> bin dong goon83 at 126.com
>> Buaa, Beijing PR China
>>
>>
>>
>>
>> 在2009-05-07?21:51:13,"Duncan?Murdoch"?<murdoch at stats.uwo.ca>?写道:
>>>
>>> On?5/7/2009?9:24?AM,?goon83?wrote:
>>>>
>>>> ?Hi?everyone,
>>>> ???I?meet?the?problem?to?call?R?from?C.?
>>>> ??
>>>>
>>>> ???Can?someone?tell?me?is?it?possible?to?call?time?series?functions(such?as?ar?and?arima)from??C?program?on?linux?platform,?and?then?compile?the?C?program?to?a?standalone?executable?file?
>>>> ?
>>>>
>>>> ???I?know?we?can?call?some?function?defined?in?Rmath.h?,?but?I?have?not?found?the?entry?point?for?time?series?function.?
>>>
>>> There?are?none,?but?you?can?write?a?front?end?for?R,?and?it?can?evaluate?
>>> R?expressions,?etc.??The?procedure?is?described?in?the?Writing?R?
>>> Extensions?manual.
>>>
>>> Remember?that?if?you?distribute?the?program?you?do?need?to?follow?the?
>>> GPL,?and?distribute?all?of?R?as?well?as?all?of?your?own?program?in?
>>> source?code?form.
>>>
>>> Duncan?Murdoch
>>>
>>>> ??
>>>> ???I?would?very?much?appreciate?receiving?your?response?!?^_^
>>>> ?
>>>> ?------------
>>>> ?bin,?dong
>>>> ?goon83 at 126.com
>>>> ?Buaa,?Beijing?PR?China
>>>> ?
>>>> ???
>>>> ?
>>>> ?       [[alternative?HTML?version?deleted]]
>>>> ?
>>>> ?______________________________________________
>>>> ?R-help at r-project.org?mailing?list
>>>> ?https://stat.ethz.ch/mailman/listinfo/r-help
>>>>
>>>> ?PLEASE?do?read?the?posting?guide?http://www.R-project.org/posting-guide.html
>>>> ?and?provide?commented,?minimal,?self-contained,?reproducible?code.
>>>
>>
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>




More information about the R-help mailing list