View source: R/fit_gam_surface.R
fit_gam_surface | R Documentation |
This is based on mgcv::gam()
and derived from openair::polarPlot()
fit_gam_surface(
data,
x,
y,
z,
weights = NULL,
k = 100,
extrapolate = FALSE,
force_positive = TRUE,
dist = 0.05
)
data |
a data.frame or tibble containing the data (wide format) |
x |
string giving the u (wind) component or x coordinate, respectively |
y |
string giving the v (wind) component or y coordinate, respectively |
z |
string giving the response variable |
weights |
vector of weights for fitting x, y value pair; can be NULL |
k |
numeric, smoothing degree in gam model mgcv::gam(z ~ s(x, y, k = k) |
extrapolate |
TRUE/FALSE, result of fit extends over NA values in z, thus providing a way of extrapolation. If FALSE, only u, v pairs with !is.na(z) are returned, if TRUE, also fitted z values within a certain distance (dist) from x, y are returned based on mgcv::exclude.too.far() |
force_positive |
TRUE/FALSE, shall fitted values forced to be positive? |
dist |
input for |
tibble with variables u, v, z
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.