v <- vect(system.file("ex/lux.shp", package = "terra"))
r <- rast(v, ncols = 75, nrows = 100)
z <- rasterize(v, r, cover = TRUE, by = "ID_2")
v <- unlist(z[30*75+28])
e <- c(0.01538462, NA, NA, NA, 0.9846154, NA, NA, NA, NA, NA, NA, NA)
tinytest::expect_equivalent(v, e, tolerance=2e-07)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.