r <- rast(nrows=4, ncols=4)
values(r) <- 1:ncell(r)
plot(r)
text(r)
plot(r)
text(r, halo=TRUE, hc="blue", col="white", hw=0.2)
plot(r, col=rainbow(16))
text(r, col=c("black", "white"), vfont=c("sans serif", "bold"), cex=2)
Run the code above in your browser using DataLab