全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1548 0
2013-06-03
You can use the rSymPy package to do a symbolic calculation in R. Here is an example.

library (rSymPy)

sympy("var('x')")
sympy("y = x*x")
sympy("y")
sympy("limit(1/x, x, oo)")

# the next line fails under jython even without R
# and seems to corrupt the rest of the session
# sympy("(1/cos(x)).series(x, 0, 10)")
sympy("diff(sin(2*x), x, 1)")
sympy("diff(sin(2*x), x, 2)")
sympy("integrate(exp(-x), (x, 0, oo))")

sympy("xr = Symbol('xr', real=True)")
sympy("exp(I*xr).expand(complex=True)")
# Matrices are stored row by row (unlike R matrices)
cat(sympy("A = Matrix([[1,x], [y,1]])"), "\n")
cat(sympy("A**2"), "\n")
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群