Re: [R] Could I use R function lm or nlm in C code?

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sat, 23 Apr 2011 06:39:27 -0400

On Sat, Apr 23, 2011 at 6:25 AM, Shuguang Sun <shuguang_at_gmail.com> wrote:
> Dear R,
>
> I'm doing some simulation work and it takes me a lot of time to do it
> in R. So I try to implement it in C code, but I want to use some R
> functions directly for my lazy and the robustness of code. For
> example, I will use lm and nlm in my program. How could I use R's lm
> and nlm function directly? I thinks these functions are not included
> in the R's include directory. Do I need to get full R's source first?
> If I have get all R's source, is it enough that I only include the
> source file for function lm or nlm?

>
> system:
> Windows XP
> R 2.13.0
> Rtools 2.13
>
>

Before moving to C, try replacing lm with the faster lm.fit (see ?lm.fit) and see if that gives you sufficient speedup for your needs.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

______________________________________________
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.
Received on Sat 23 Apr 2011 - 10:41:44 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 23 Apr 2011 - 12:40:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive