[R] symbolic math

James Foadi foadi at ysbl.york.ac.uk
Wed Oct 26 12:20:13 CEST 2005


On Wednesday 26 October 2005 10:55, Giannitrapani, Marco GSUK-GSSC wrote:
> Hi all!
>
> Does anyone knows if it exists a "symbolic math" package in R, that allows
> to compute derivatives, integrals, etc.?
>
> Does exist a freeware version of Maple?
>
> Cheers,
>
> Marco
>
I've just learned yesterday the use of "expressions" objects to compute 
derivatives. There might be functions for doing integrals as well.

1) define an expression using whatever symbol you like

example:

> exp1 <- expression(cos(x)+sin(y))

2) Use function D() to perform symbolic derivatives:

example:

> D(exp1,"x")
-sin(x)
> D(exp1,"y")
cos(x)

 You can find this stuff in "R for Beginners", by Emmanuel Paradis 
(http://www.r-project.org/)

Cheers,

J

-- 
Dr James Foadi PhD
York Structural Biology Laboratory (YSBL)
Department of Chemistry
University of York
Heslington
York YO10 5YW
UK




More information about the R-help mailing list