[R] How can I solve this function in R?

Paul Smith phhs80 at gmail.com
Mon Jun 2 17:58:18 CEST 2008


On Mon, Jun 2, 2008 at 4:31 PM, François Aucoin <frank.aucoin at gmail.com> wrote:
> I would like to solve the following function in R:
>
> G <- function(k)  (2*(1 - k)*(1 + 2*k)^.5)/(1+3*k)
>
> I want to be able to find "k" for a given "G"

Consider G(k)-g. With plot look for intervals where the roots lie in.
Afterwards, use uniroot to get the roots.

Paul



More information about the R-help mailing list