requation

Solving equation solution in R


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!


Solution

  • Try this:

    > library(Ryacas)
    > x <- Sym("x"); y <- Sym("y")
    > Simplify(Solve(2*x == 2*y, x))
    expression(list(x - y == 0))