# sf objects
sfobj <- sf::st_as_sfc("MULTIPOINT ((0 0), (1 1))", crs = 4326)
fromsf1 <- pull_crs(sfobj)
fromsf2 <- pull_crs(sf::st_crs(sfobj))
# terra
v <- terra::vect(sfobj)
r <- terra::rast(v)
fromterra1 <- pull_crs(v)
fromterra2 <- pull_crs(r)
# integers
fromint <- pull_crs(4326)
# Characters
fromchar <- pull_crs("epsg:4326")
all(
fromsf1 == fromsf2,
fromsf2 == fromterra1,
fromterra1 == fromterra2,
fromterra2 == fromint,
fromint == fromchar
)
cat(fromsf1)
Run the code above in your browser using DataLab