plot.itp {itp}R Documentation

Plot method for objects of class "itp"

Description

Plot method for objects of class "itp" returned from itp.

Usage

## S3 method for class 'itp'
plot(x, ...)

Arguments

x

An object inheriting from class "itp", a result of a call to itp.

...

Arguments passed to curve, such as graphical parameters.

Details

Uses curve to produce a plot of the function f provided to itp over the interval within which a root was sought. The estimated root is indicated using a horizontal line drawn at 0 and a vertical line drawn at the estimated root. By default the name of the function f is used as a title, but this can be replaced by supplying the argument main. The interval over which f is plotted can be changed by supplying the arguments from and/or to.

Value

No return value, only the plot is produced.

See Also

itp for the Interpolate, Truncate, Project (ITP) root finding algorithm.

Examples

# Lambert

# Supplying an R function
lambert <- function(x) x * exp(x) - 1
x <- itp(lambert, c(-1, 1))
plot(x)

# Supplying an external pointer to a C++ function
lambert_ptr <- xptr_create("lambert")
x <- itp(lambert_ptr, c(-1, 1))
plot(x, main = "Lambert")

[Package itp version 1.2.1 Index]