approxExtrap: Linear Extrapolation

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Misc.s

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

1
2
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

approx

Examples

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

Example output

Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, round.POSIXt, trunc.POSIXt, units

$x
[1] 0 4

$y
[1] 0 4

Hmisc documentation built on May 30, 2017, 8:23 a.m.

Search within the Hmisc package
Search all R packages, documentation and source code