interp: Linear interpolartion function

Description Usage Arguments See Also Examples

View source: R/interp.R

Description

Return a list of points which linearly interpolate given data points. The missing values are estimated using the nslm function.

Usage

1
interp(x, y, z, df = "BIC", raw = FALSE)

Arguments

x,y

numeric vectors giving the coordinates of the points to be interpolated.

z

an optional set of numeric values specifying where interpolation is to take place.

df

If raw=FALSE it defines the way how the number of degrees of freedom for the Natural Cubic Spline used in nslm for estimating the missing values using AIC, BIC or the sum of squared errors. Possible values are: "BIC" (default), "AIC", "LSE" (for sum of squared errors) or numeric value for df given by the user.

raw

If FALSE (default) it uses nslm for estimating the missing values, otherwise it uses approx only.

See Also

nslm, approx, ns

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(Tests)

x <- Tests[Tests$Sample == "P", "x"]
y <- Tests[Tests$Sample == "P", "y"]

st.x <- smoothtab(x)$table
st.y <- smoothtab(y)$table

interp(st.x$prob, st.x$score, st.y$prob, raw=TRUE)
interp(st.x$prob, st.x$score, st.y$prob)

twolodzko/equi documentation built on Nov. 11, 2020, 4:04 p.m.