Nane
Nane

Reputation: 15

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!

Upvotes: 0

Views: 260

Answers (1)

G. Grothendieck
G. Grothendieck

Reputation: 270268

Try this:

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

Upvotes: 2

Related Questions