Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

approxExtrap

Linear Extrapolation


Description

Works in conjunction with the approx function to do linear extrapolation. approx in R does not support extrapolation at all, and it is buggy in S-Plus 6.

Usage

approxExtrap(x, y, xout, method = "linear", n = 50, rule = 2, f = 0,
             ties = "ordered", na.rm = FALSE)

Arguments

x,y,xout,method,n,rule,f

see approx

ties

applies only to R. See approx

na.rm

set to TRUE to remove NAs in x and y before proceeding

Details

Duplicates in x (and corresponding y elements) are removed before using approx.

Value

a vector the same length as xout

Author(s)

Frank Harrell

See Also

Examples

approxExtrap(1:3,1:3,xout=c(0,4))

Hmisc

Harrell Miscellaneous

v4.5-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>, with contributions from Charles Dupont and many others.
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.