Hi e eeyore,

Here is one way:

fx <- function(x, m) x*2/(3*m)*(1-x/(3*m))
foo <- function(m) integrate(fx, m = m, lower = 0, upper = 3*m)$value
foo(3)
# 3
foo(2)
# 2

And remember:

#install.packages('fortunes')
require(fortunes)
fortune('Yoda')

Evelyn Hall: I would like to know how (if) I can extract some of the
information
from the summary of my nlme.
Simon Blomberg: This is R. There is no if. Only how.
   -- Evelyn Hall and Simon 'Yoda' Blomberg
      R-help (April 2005)

HTH,
Jorge.-


On Sun, Dec 4, 2011 at 11:23 AM, e eeyore <> wrote:

> I know that is not Mhatematica, my question is only is it possible, it
> seams its not..
>
> Sorry if I did not get it, I can interprete different your answer, not
> intentionally..
>
> Thanks for your answer and patience.
>
>
> On Sun, Dec 4, 2011 at 5:15 PM, David Winsemius <>wrote:
>
> >
> > On Dec 4, 2011, at 11:04 AM, e eeyore wrote:
> >
> >
> >
> > On Sun, Dec 4, 2011 at 4:47 PM, David Winsemius <>wrote:
> >
> >>
> >> You almost did write it in R. You just left the "m" unspecified. If you
> >> replace "m" by 5 the code works.
> >>
> >
> > Check how wolfram work with same integral, I dont need to replace
> > anything..
> >
> >
> http://www.wolframalpha.com/input/?i=integrate+x*2%2F%283*m%29*%281-x%2F%283*m%29%29+dx+from+x%3D0+to+3*m
> >
> > I need only answer is possible in R do the same work and get the same
> > result and if is how.
> >
> > You dont need to try be funny..
> >
> >
> > Sometimes my sarcasm is under-interpreted, but in this case no sarcasm
> was
> > intended. I told you in an earlier post that R does not do symbolic
> > algebra. Your counter-example points to a program that does. Bottom
> line: R
> > is not Mathematica. Complaining about that fact is not going to get you
> > anywhere. There is a package which provides an interface to the
> open-source
> > Yacas system if you want to pursue an R-centric approach.
> >
> > --
> >
> >
> > David Winsemius, MD
> > West Hartford, CT
> >
> >
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

