bestfitplane | R Documentation |
Finds the best fit polynomial surface for a raster or matrix. This function tests least squares polynomial fits with orders of 0 - 3 and determines which order minimizes the error when the fit is subtracted from the original image.
bestfitplane(x)
x |
A raster or matrix. |
A raster or matrix of the same size as the input with values predicted from the best polynomial fit.
# import raster image
data(orforest)
orforest <- terra::unwrap(orforest)
# find the least squares polynomial surface
poly <- bestfitplane(orforest)
# plot the fit
terra::plot(poly)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.