Re: [R] Improving data processing efficiency

From: Horace Tso <Horace.Tso_at_pgn.com>
Date: Fri, 06 Jun 2008 16:46:35 -0700

Daniel, allow me to step off the party line here for a moment, in a problem like this it's better to code your function in C and then call it from R. You get vast amount of performance improvement instantly. (From what I see the process of recoding in C should be quite straight forward.)

H.

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Daniel Folkinshteyn Sent: Friday, June 06, 2008 4:35 PM
To: hadley wickham
Cc: r-help_at_r-project.org; Patrick Burns
Subject: Re: [R] Improving data processing efficiency

> install.packages("profr")
> library(profr)
> p <- profr(fcn_create_nonissuing_match_by_quarterssinceissue(...))
> plot(p)
>
> That should at least help you see where the slow bits are.
>
> Hadley
>

so profiling reveals that '[.data.frame' and '[[.data.frame' and '[' are the biggest timesuckers...

i suppose i'll try using matrices and see how that stacks up (since all my cols are numeric, should be a problem-free approach).

but i'm really wondering if there isn't some neat vectorized approach i could use to avoid at least one of the nested loops...



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. Received on Fri 06 Jun 2008 - 23:49:29 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 07 Jun 2008 - 00:30:48 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