Given:
library(terra)
r <- rast( extent=c( -108, -105, 39, 42 ), ncol=14, nrow=14, crs="epsg:4326" )
values(r) <- 1:ncell(r)
x <- c(r, r*2, r*3, r*0.5)
x.df <- as.data.frame(x, cell=TRUE)
head(x.df)
Assuming I do some changes in x.df, how can I go back to a SpatRaster? In other words, which is the inverse of as.data.frame()?