Timeline for Which components of this r loop are inefficient?
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 21, 2013 at 8:26 | comment | added | Roland | Operations on data.frames (subsetting, assignment,...) are slow. If all the results are numeric, you should use a matrix to store them. And definitely pre-allocate the output data structure. | |
| Feb 21, 2013 at 4:34 | history | migrated | from stackoverflow.com (revisions) | ||
| Feb 20, 2013 at 19:11 | comment | added | dubhousing | Thanks @Dwin - the approach described at this page is to use rprof([output file]) and rprof(NULL) around the code, and then consult the output file to see what's taking the most time. Are there other approaches you might recommend? | |
| Feb 20, 2013 at 19:03 | comment | added | DWin | You should learn to use the R profiling tools. At the moment with no data to work with you're just asking for guesses. My guess is that it is the calls to regression functions and summary() calls that are using most of the cycles. | |
| Feb 20, 2013 at 18:27 | answer | added | Oscar de León | timeline score: 4 | |
| Feb 20, 2013 at 18:24 | comment | added | Oscar de León | Tried to post a short answer here but, due to formatting issues, I'll post it as an answer. If you need help with it let me know. | |
| Feb 20, 2013 at 18:09 | history | asked | dubhousing | CC BY-SA 3.0 |