Re: [R] Linear system

From: Sundar Dorai-Raj <sundar.dorai-raj_at_pdf.com>
Date: Wed 25 May 2005 - 22:53:18 EST

Jim Gustafsson wrote:
> Dear R-help
>
> I have a problem solving a linear system like
>
> 353a+45b+29c=79
> 45a+29b+3c=5
> 29a+3b+4c=8
>
> Is there any way of doing this in R?
>
> Best Regards
> Jim
>

Use ?solve:

X <- matrix(c(353, 45, 29,

                45, 29,  3,
                29,  3,  4), 3, 3, byrow = TRUE)
y <- c(79, 5, 8)
b <- solve(X, y)

Have you read the posting guide? In particular, have you tried simple queries using help.search or the R archives? This question has been answered many times.

HTH, --sundar



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed May 25 23:18:03 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:05 EST