View source: R/pwutilityfunctions.R
inverse | R Documentation |
From https://stackoverflow.com/questions/45616072/find-the-inverse-function-in-r
inverse(fn, interval = NULL, lower = min(interval), upper = max(interval), ...)
fn |
Monotonous function |
interval |
Vector defining the domain |
lower |
Numeric, inferred from interval or given explicitly here |
upper |
Numeric, inferred from interval or given explicitly here |
... |
Further parameters to uniroot() |
Function (vectorized) computing the inverse of fn
x <- 1:10
y <- sqrt(x)
sqrt.inv <- inverse(sqrt, lower = 1, upper = 10)
sqrt.inv(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.