View source: R/spatial_utils.R
| terra2im | R Documentation | 
convert at terra raster to a spatstat image taken from maptools and converted to terra
terra2im(rast, factor.col.name = NULL)
| rast | rast A terra raster to convert to a spatstat image | 
| factor.col.name | string Names of factors in the raster to convert to window | 
library(ppmData)
library(terra)
path <- system.file("extdata", package = "ppmData")
lst <- list.files(path=path,pattern='*.tif',full.names = TRUE)
covariates <- rast(lst[1])
im.r <- terra2im(covariates)
plot(im.r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.