Message-ID: <4294753E.1070807@pdf.com>
Date: 2005-05-25T12:53:18Z
From: Sundar Dorai-Raj
Subject: Linear system
In-Reply-To: <OFEBD26836.8D959867-ONC125700C.00445498-C125700C.0044BBA4@codan.dk>
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