The following functions in the raster package are designed to work with cell indexes.
fun(r, cell)
[adjacentcolFromCellrasterFromCellsrowColFromCellrowFromCellvalidCellxyFromCellxFromCellyFromCellThe following functions will return cell indexes.
fun(r, query) to return cells
cellFromColcellFromLinecellFromPolygoncellFromRowcellFromRowColcellFromRowColCombinecellFromXYcellsFromExtentfourCellsFromXYOthers
setValues will work as fun(r, vals, index) only for RasterLayerSparseThe sparse raster is a under-used feature and needs to be fleshed out.