[R-sig-Geo] How to use st_rasterize (stars) for a categorical field like terra does?

Manuel Spínola m@p|no|@10 @end|ng |rom gm@||@com
Fri Sep 30 17:08:09 CEST 2022


Dear list members,

When using the terra package:

f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
r <- rast(v, ncols=75, nrows=100)
z <- rasterize(v, r, "NAME_2")
plot(z)
lines(v)

How can I obtain the same result using st_rasterize from stars?

Manuel

-- 
*Manuel Spínola, Ph.D.*
Instituto Internacional en Conservación y Manejo de Vida Silvestre
Universidad Nacional
Apartado 1350-3000
Heredia
COSTA RICA
mspinola using una.cr <mspinola using una.ac.cr>
mspinola10 using gmail.com
Teléfono: (506) 8706 - 4662
Institutional website: ICOMVIS
<http://www.icomvis.una.ac.cr/index.php/manuel>
Blog sobre Ciencia de Datos: https://mspinola-ciencia-de-datos.netlify.app

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list