[R] calculate quantiles of a custom function

Gerhard feldspat at gmx.net
Tue Jan 3 13:24:04 CET 2012


Hi,

I guess that my problem has an obvious answer, but I have not been able to 
find it.

Suppose I create a custom function, consisting of two beta-distributions:

myfunction <- function(x) {
  dbeta(x,2,6) + dbeta(x,6,2)
}

How can I calculate the quantiles of myfunction? 

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).

Thank you in advance,

Gerhard



More information about the R-help mailing list