View source: R/functions_range.R
fitLoess | R Documentation |
Wrapper function for fitting and predicting from loess()
.
fitLoess(y, x, newx = x, span = 0.5, ...)
y |
Dependent variable values |
x |
Independent variable values |
newx |
Values of x to use for prediction. |
span |
Controls the amount of smoothing. Passed to |
... |
Additional arguments passed to |
x <- seq(0, 5, length=50)
y <- cos(4*x) + rnorm(50, sd=0.5)
xplot <- seq(0, 5, length=200)
lfit <- fitLoess(y=y, x=x, newx=xplot, span=0.2)
plot(x, y)
points(xplot, lfit, type="l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.