Am Dienstag, 3. Januar 2012, 11:05:11 schrieben Sie: > > The quick way is to look at the structure with 'str': > > str(integrate(myfunction,0,.9)) > List of 5 > $ value : num 1.85 > $ abs.error : num 2.05e-14 > $ subdivisions: int 1 > $ message : chr "OK" > $ call : language integrate(f = myfunction, lower = 0, upper > = 0.9) > - attr(*, "class")= chr "integrate" > > The longer way would be to look at the help)integrate) page where the > "Value" section would have told you that a list with named components > > was returned: > > integrate(myfunction,0,.9)$value > > [1] 1.850299 > > In this instance you could also probably use 'cumsum' (which is just > doing the numerical integration by hand > > plot(cumsum( myfunction(seq(0,1,by=0.001)))/ > sum(myfunction(seq(0,1,by=0.001)) ) )
Thanks a lot; now I now where I need to look for help before bothering you again. Best, Gerhard > > > I need to hand on the value to another function, and then I get an > > error > > message, because the output of integrate is not a numerical argument. > > > >>> I have not seen any continous function treated in the docs, and > >>> applying the > >>> "quantile function" gives me an error (since it seems only to be > >>> defined on > >>> lists and atoms). > >> > >> There is also a family of packages, all of whose names begin with > >> "distr". They provide a variety of facilities for developing new > >> distributions, both discrete and continuous. > > > > That looks quite frightening. But if it turns out to be necessary. > > But a good way to improve you knowledge of statistical concepts. > > > Thank you, > > > > Gerhard > > David Winsemius, MD > West Hartford, CT ______________________________________________ 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.