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? Many thanks! My best. [[alternative HTML version deleted]]
Hi> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at 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 at 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.
Dear meng, Check I understood correctly, the Ryacas package might do what you want. Check its vignette at http://cran.r-project.org/web/packages/Ryacas/vignettes/Ryacas.pdf Best, Jorge.- On Fri, Jan 4, 2013 at 5:59 PM, meng <> wrote:> 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? > > 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. >[[alternative HTML version deleted]]