LagrangeInterpolate: LagrangeInterpolate

LagrangeInterpolateR Documentation

LagrangeInterpolate

Description

Interpolates tabulated values via Lagrange interpolation

Usage

LagrangeInterpolate(.x, .n, .D)

Arguments

.x

Value of variable #1 for which interpolated result is to be returned

.n

Number of points to use (order of polynomial will be .n-1). The value provided must be in the range from 2 to 10; otherwise NA is returned.

.D

Data.frame containing the two variables to use for interpolation

Details

The routine takes as input a data.frame with two variables, one to be used for interpolation of values in the second. It returns the value of the second variable corresponding to the provided value of the first variable.

Value

The interpolated value of variable #2 corresponding to the value provided for variable #1 (.x)

Author(s)

William Cooper

Examples

LagrangeInterpolate (3.3, 3, data.frame (1:5, 1:5+runif(5,-0.1,0.1)))

NCAR/Ranadu documentation built on Jan. 27, 2023, 1:09 a.m.