This function converts the bin_mat slot of an STGrid object into an x/y matrix (e.g. to be displayed using image())

# S4 method for STGrid
as_matrix(object, feature = NULL)

Arguments

object

The STGrid object

feature

The (meta)feature of interest.

Examples

example_dataset()
#> |-- INFO :  Dataset 11284233/files/Xenium_Mouse_Brain_Coronal_7g was already loaded. 
xen <- Xenium_Mouse_Brain_Coronal_7g
image(as_matrix(xen))
#> Error in if (!(value.var %in% names(data))) {    stop("value.var (", value.var, ") not found in input", call. = FALSE)}: argument is of length zero