Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cellFromXY

Get cell number from row, column or XY


Description

Get cell number(s) of a Raster*TS object from row and column numbers or X and Y coordinates.

Usage

cellFromXY(object, xy)
cellFromRowCol(object, row, col,...)

Arguments

object

a raster time series (Raster*TS) object created by rts

col

column number; or vector of column numbers

row

row number; or vector of row numbers

xy

matrix of x and y coordinates, or a SpatialPoints or SpatialPointsDataFrame object

...

additional arguments (none implemented)

Details

These functions are essentially a wrapper to cellFromRowCol and cellFromXY in raster package, work with Raster*TS objects.

Value

row, column or cell number(s). cellFromLine and cellFromPolygon return a list.

Author(s)

Examples

## Not run: 
file <- system.file("external/ndvi", package="rts")

rt <- rts(file) # read the ndvi time series from the specified file
cellFromRowCol(rt,15,20)

cellFromRowCol(rt,c(16:20),c(11:15))

cellFromXY(rt,c(645000,57345000))

## End(Not run)

rts

Raster Time Series Analysis

v1.0-49
GPL (>= 3)
Authors
Babak Naimi
Initial release
2019-02-01

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.