Skip to contents

Coerce to matrix

Usage

# S4 method for class 'spatLocsObj'
as.matrix(x, id_rownames = TRUE, ...)

# S4 method for class 'nnNetObj'
as.matrix(x, attr = NULL, ...)

Arguments

x

object to coerce

id_rownames

logical. Retain the spatial IDs as the rownames

...

additional params to pass (none implemented)

attr

Either NULL or character providing the name of an edge attribute to include in the ajacency matrix. The edge attribute to use must be either logical or numeric.

Value

matrix

See also

Other As coercion functions: as.data.table(), as.points(), as.polygons(), r_spatial_conversions

Examples

sl <- GiottoData::loadSubObjectMini("spatLocsObj")
m <- as.matrix(sl)