Ryacas 包可以做限制:
library(Ryacas) # version 1.1.1
x <- ysym("x") # define x as a symbolic variable
lim(sin(x)/x, x, 0) # limit of sin(x)/x as x approaches 0
## 1
Run Code Online (Sandbox Code Playgroud)
或在 Ryacas0
library(Ryacas)
x <- Sym("x") # define x as a symbolic variable
Limit(sin(x)/x, x, 0) # limit of sin(x)/x as x approaches 0
## expression(1)
Run Code Online (Sandbox Code Playgroud)
还有 rSymPy 包:
library(rSymPy) # version 0.2-1.2
sympy("var('x')") # define x as a symbolic variable
## [1] "x"
sympy("limit(sin(x)/x, x, 0)")
## [1] "1"
Run Code Online (Sandbox Code Playgroud)