Hi > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of meng > Sent: Friday, January 04, 2013 8:00 AM > To: R help > Subject: [R] a question about the computation of expression > > Hi all: > I have a question about the computation of expression: > y = 1+(2x1+2)-3*(5x1-1)+(3x2+3)-2*(x2-1) > > The result of y is: > y = 11-13x1+x2 > > How can I compute the result of y via R function?
Dou you have x1 and x2? If yes and they are vectors with the same length y = 11-13*x1+x2 shall do the computation. Or maybe I did not understand what do you want. Regards Petr > > Many thanks! > > My best. > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.