An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080424/52224125/attachment.pl
Can I get rid of this for loop using apply?
2 messages · Mike Dugas, Hadley Wickham
Great suggestions. I tested the code on an example and the run time was reduced from 1 min 12 sec to 3 sec. Also, I like the suggestion to look at the quantiles. I will see what insight it provides in terms of detecting masked interactions.
Well that's a decent speed up :)
I have a couple questions about your code. First, why not use xs <- seq(min(x1), max(x1), length = 100) instead of xs <- with(m, seq(min(x1), max(x1), length = 100)) ?
No real reason, just to make it a bit easier when you generalise to other data sets / models
Second, what is the function geom_line()? I couldn't find it.
It's in ggplot2 - http://had.co.nz/ggplot2/geom_line.html - ?geom_line should find it too though (provided you have version 0.6 of ggplot2) Hadley