I have a matrix like the following one, obtained from a raster file:
0 0 0 0 0 0 0 4 254 252
0 0 0 0 0 0 0 0 255 246
0 0 0 0 0 0 0 1 255 246
0 0 0 0 0 4 32 254 255 246
0 0 0 0 8 255 255 255 255 246
0 0 0 0 0 11 214 254 255 246
0 0 0 0 0 0 0 1 255 246
0 0 0 0 0 0 0 1 255 246
1 0 0 0 0 0 0 2 255 253
247 247 247 247 247 247 247 247 249 251
And I would like to use a Gaussian filter with a radiux "x" that is able to estimate standard deviation and mean of the considered pixel values within this radius. As output I would like to get a matrix for the "mean" (estimated for each pixel by using the filtering radius) and a matrix for the "standard deviation".
Do you have any suggestion on how to do it in R?