gInterpol: Interpolate y value for general y value not for concentration

View source: R/gInterpol.R

gInterpolR Documentation

Interpolate y value for general y value not for concentration

Description

It interpolates y value when a corresponding x value (xnew) does not exist within x vector

Usage

gInterpol(x, y, xnew, Outer="NEAREST")

Arguments

x

vector values of x-axis, usually time

y

vector values of y-axis, usually concentration

xnew

new x point to be interpolated, usually new time point

Outer

indicates how to do the out of x range point

Details

This function interpolate y value, if xnew is not in x vector. If xnew is in the x vector, it just returns the given x and y vector. This function usually is called by gIntAUC function Returned vector is sorted in the order of increasing x values.

Value

new x and y vector containing xnew and ynew point

Author(s)

Kyun-Seop Bae <k@acr.kr>

See Also

gIntAUC

Examples

x = 1:10 + 0.1
y = -2*x + 40.2
gInterpol(x, y, 1.5)
gInterpol(x, y, 0.5) # Out of range, Left
gInterpol(x, y, 11) # Out of range, Left

NonCompart documentation built on Nov. 15, 2023, 9:06 a.m.