Get the number of rows of a spatial object.

getRows(x, ...)

# S4 method for ANY
getRows(x)

# S4 method for geom
getRows(x)

# S4 method for Raster
getRows(x)

# S4 method for SpatRaster
getRows(x)

# S4 method for matrix
getRows(x)

Arguments

x

the object from which to get the number of rows.

...

other arguments.

Value

An integer of the number of rows.

See also

Examples


getRows(gtGeoms$grid$categorical)
#> [1] 56

gc_raster(gtGeoms$grid$categorical) %>%
  getRows()
#> [1] 56

gc_terra(gtGeoms$grid$categorical) %>%
  getRows()
#> [1] 56

getRows(x = matrix(0, 3, 5))
#> [1] 3