Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/kernel_smoother.R
kernel_smoother
is used to transform a vector.
1 | kernel_smoother(x, kernel = "gaussian")
|
x |
Vector to transform/smooth. |
kernel |
Type of smoothing kernel to apply to |
Current kernels which are supported are:
Gaussian/normal
Epanechnikov
Logistic
Cosine
Triangular
Box/uniform
Tricube
Triweight
Biweight/quartic
Vector the length of x
.
Stuart K. Grange
1 2 3 4 5 6 7 8 9 | # Create vector
vector <- seq(-5, 5, by = 0.1)
# Transform
vector_smooth <- kernel_smoother(vector, "gaussian")
# Or use a different kernel
vector_smooth_epanechnikov <- kernel_smoother(vector, "epanechnikov")
# plot(vector_smooth_epanechnikov, type = "l")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.