r <- rast()
crs(r)
crs(r, describe=TRUE, proj=TRUE)
crs(r) <- "+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100 +ellps=WGS84"
crs(r)
# You can use epsg codes
crs(r) <- "epsg:25831"
crs(r, describe=TRUE)$area
crs("epsg:25831", describe=TRUE)
Run the code above in your browser using DataLab