Show the head (first rows/columns) or tail (last rows/columns) of the cell values of a Raster* object.

head(x, ...) 
tail(x, ...)

Arguments

x

Raster* object

...

Additional arguments: rows=10 and cols=20, to set the maximum number of rows and columns that are shown. For RasterStack and RasterBrick objects there is an additional argument lyrs

Value

matrix

See also

Examples

r <- raster(nrow=25, ncol=25)
values(r) = 1:ncell(r)
head(r)
#>      1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19
#> 1    1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19
#> 2   26  27  28  29  30  31  32  33  34  35  36  37  38  39  40  41  42  43  44
#> 3   51  52  53  54  55  56  57  58  59  60  61  62  63  64  65  66  67  68  69
#> 4   76  77  78  79  80  81  82  83  84  85  86  87  88  89  90  91  92  93  94
#> 5  101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
#> 6  126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
#> 7  151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
#> 8  176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
#> 9  201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
#> 10 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
#>     20
#> 1   20
#> 2   45
#> 3   70
#> 4   95
#> 5  120
#> 6  145
#> 7  170
#> 8  195
#> 9  220
#> 10 245
tail(r, cols=10, rows=5)
#>     16  17  18  19  20  21  22  23  24  25
#> 21 516 517 518 519 520 521 522 523 524 525
#> 22 541 542 543 544 545 546 547 548 549 550
#> 23 566 567 568 569 570 571 572 573 574 575
#> 24 591 592 593 594 595 596 597 598 599 600
#> 25 616 617 618 619 620 621 622 623 624 625