0

I need R to give me this kind of non-numeric solution :

2*x = 2*y
solution { x = y }

Do you know if there are some packages who do that ? Thanks in advance!

Nane
  • 15
  • 3

1 Answers1

2

Try this:

> library(Ryacas)
> x <- Sym("x"); y <- Sym("y")
> Simplify(Solve(2*x == 2*y, x))
expression(list(x - y == 0))
G. Grothendieck
  • 254,981
  • 17
  • 203
  • 341
  • 1
    Care to add an explanation of *why* op should try it, what's wrong with what they've got, etc.? – ChiefTwoPencils Jun 15 '14 at 00:33
  • 1
    @ChiefTwoPencils good point in general, but here what Nane wrote is not even syntactically correct in R. Further, the `solution` function does not exist. I'm guessing the OP knew this and was just giving an example of what he/she wants, not asking why it does not work. – scottkosty Jun 15 '14 at 05:54