Re: [R] simplification of code using stamp?

2006-10-26 Thread Rainer M Krug
hadley wickham wrote: I get the following, which is not what I am looking for. test[1:10,] expertxx seeds runvalue 1 BW x001025 1 rsqs, slope, d.slope, intercept, d.intercept 2 BW x001025 2 rsqs, slope, d.slope,

[R] simplification of code using stamp?

2006-10-25 Thread Rainer M Krug
Hi I have the following code which I would like to simplify. Id does linear regressions and returns the r-squares, and the coefficients. It runs slow, as it is doing the regressions for each - is it possible to get the values in a dataframe which looks as follow: expert | xx | seeds |

Re: [R] simplification of code using stamp?

2006-10-25 Thread ONKELINX, Thierry
Aan: r-help@stat.math.ethz.ch Onderwerp: [R] simplification of code using stamp? Hi I have the following code which I would like to simplify. Id does linear regressions and returns the r-squares, and the coefficients. It runs slow, as it is doing the regressions for each - is it possible to get

Re: [R] simplification of code using stamp?

2006-10-25 Thread ONKELINX, Thierry
: [R] simplification of code using stamp? I think your script is slow because it has to recalculate the same model five times. I've tried to avoid this by rewriting your function(df). function(df){ fit - summary(lm(distance ~ generation, data=df)) result - c(fit$$r.squared

Re: [R] simplification of code using stamp?

2006-10-25 Thread Rainer M Krug
ONKELINX, Thierry wrote: Resending the function because of a typo in the result vector. function(df){ fit - summary(lm(distance ~ generation, data=df)) result - c(fit$r.squared, fit$coefficients[2], fit$coefficients[4], fit$coefficients[1], fit$coefficients[3])

Re: [R] simplification of code using stamp?

2006-10-25 Thread hadley wickham
I get the following, which is not what I am looking for. test[1:10,] expertxx seeds runvalue 1 BW x001025 1 rsqs, slope, d.slope, intercept, d.intercept 2 BW x001025 2 rsqs, slope, d.slope, intercept, d.intercept 3