Description Usage Arguments Value See Also Examples
This function returns a matrix (or matrices) for all focal values of a number of rows of a Raster* object
1 2 |
x |
Raster* object |
row |
Numeric. Row number, should be between 1 and nrow(x). Can be omitted to get all rows |
nrows |
Numeric. Number of rows, should be a positive integer smaller than |
ngb |
Neighbourhood size. Either a single integer or a vector of two integers |
names |
logical. If |
padValue |
numeric. The value of the cells of the "padded" rows and columns. That is 'virtual' values for cells within a neighbourhood, but outside the raster |
array |
logical. If |
... |
additional arguments (none implemented) |
If x
has a single layer, a matrix with one row for each focal cell, and one column for each neighbourhood cell around it.
If x
has multiple layers, an array (if array=TRUE
) or a list of such matrices (one list element (matrix) for each layer)
1 2 3 4 5 |
Loading required package: sp
[,1] [,2] [,3] [,4] [,5]
[1,] 1 2 3 4 5
[2,] 6 7 8 9 10
[3,] 11 12 13 14 15
[4,] 16 17 18 19 20
[5,] 21 22 23 24 25
r1c1 r1c2 r1c3 r2c1 r2c2 r2c3 r3c1 r3c2 r3c3
1 NA NA NA NA 1 2 NA 6 7
2 NA NA NA 1 2 3 6 7 8
3 NA NA NA 2 3 4 7 8 9
4 NA NA NA 3 4 5 8 9 10
5 NA NA NA 4 5 NA 9 10 NA
6 NA 1 2 NA 6 7 NA 11 12
7 1 2 3 6 7 8 11 12 13
8 2 3 4 7 8 9 12 13 14
9 3 4 5 8 9 10 13 14 15
10 4 5 NA 9 10 NA 14 15 NA
, , layer.1
r1c1 r1c2 r1c3 r2c1 r2c2 r2c3 r3c1 r3c2 r3c3
1 NA NA NA NA 1 2 NA 6 7
2 NA NA NA 1 2 3 6 7 8
3 NA NA NA 2 3 4 7 8 9
4 NA NA NA 3 4 5 8 9 10
5 NA NA NA 4 5 NA 9 10 NA
, , layer.2
r1c1 r1c2 r1c3 r2c1 r2c2 r2c3 r3c1 r3c2 r3c3
1 NA NA NA NA 1 2 NA 6 7
2 NA NA NA 1 2 3 6 7 8
3 NA NA NA 2 3 4 7 8 9
4 NA NA NA 3 4 5 8 9 10
5 NA NA NA 4 5 NA 9 10 NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.