Learn R Programming

kubik (version 0.2.0)

15_solve_method: Solve Method

Description

Solve method, for chs objects.

Usage

# S3 method for chs
solve(a, b, …, to.list=FALSE)

Arguments

a

A chs object.

b

A vector of y values.

to.list

If true, return list. Ignored, if b has length two or greater.

Other arguments, for the roots.chs.eval function.

Value

If to.list is false (the default), and length (b) is one: It returns a single numeric vector.

Otherwise: It returns a list of numeric vectors, one for each value in b.

Details

This function is a wrapper for roots.chs.eval. (It calls roots.chs.eval with modified cy values).

It computes x values, where the spline's y value is equal to the values in b.

References

Please refer to the help page for chs for background information and references.

See Also

chs, roots.chs

Examples

Run this code
# NOT RUN {
#control points
cx <- 1:4
cy <- c (-4, -1, 1, 4)

#cubic hermite spline
#(with function object, and default slopes)
f <- chs (cx, cy)

#solve for x, given y=2
solve (f, 2)
# }

Run the code above in your browser using DataLab