SpatRaster with at leat two layers. The first is the "Y" (dependent) variable and the remainder are the "X" (independent) variables
w
window. The window can be defined as one (for a square) or two numbers (row, col); or with an odd-sized weights matrix. See the Details section in focal
na.rm
logical. Should missing values be removed?
fillvalue
numeric. The value of the cells in the virtual rows and columns outside of the raster
expand
logical. If TRUE The value of the cells in the virtual rows and columns outside of the raster are set to be the same as the value on the border
filename
character. Output filename
...
additional arguments for writing files as in writeRaster