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

From: Paul Smith <phhs80_at_gmail.com>
Date: Mon, 02 Jun 2008 16:58:18 +0100

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



R-help_at_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. Received on Mon 02 Jun 2008 - 18:19:11 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 02 Jun 2008 - 18:30:40 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive