=1)
plot(X, sum of the four linear functions)
I started with a function for summing
summing - function(a,b)
{temp -0;
for (i in 1:length(a))
temp - temp + a[i]*X+b[i]
}
plot(X, summing(a,b))
I am a R beginner. I am looking for a more efficient R code.
Any help or advice will be appreciated
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Taka Matzmoto
Sent: Monday, June 26, 2006 5:21 PM
To: r-help@stat.math.ethz.ch
Subject: [R] looking for a more efficient R code.
Dear R-users
I have four simple linear models, which are all
- function(a,b)
{temp -0;
for (i in 1:length(a))
temp - temp + a[i]*X+b[i]
}
plot(X, summing(a,b))
I am a R beginner. I am looking for a more efficient R code.
Any help or advice will be appreciated.
Taka,
__
R-help@stat.math.ethz.ch mailing list
started with a function for summing
summing - function(a,b)
{temp -0;
for (i in 1:length(a))
temp - temp + a[i]*X+b[i]
}
plot(X, summing(a,b))
I am a R beginner. I am looking for a more efficient R code.
Any help or advice will be appreciated.
Taka