Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
2

If I understand correctly, you are trying to subtract 1000 from the x coords. Here is how I would go about it: library(sf) p1 <- rbind(c(1000,1000), c(1000,2000), c(2000,2000), c(1000,1000)) pol <-st_polygon(list(p1)) pol_geom = st_sfc(pol, crs = 4326) # Getting the coordinates of pol_geom coords = st_coordinates(pol_geom) new_coords = coords[,1:2] ...


1

Simple example: library(sf) nc <- st_read(system.file("shape/nc.shp", package="sf")) nc1 <- st_transform(nc[1, ], 32617) nc2 <- st_geometry(nc1) - c(1000, 0) plot(nc1[0], axes = T, reset = F) plot(nc2, add = T, col = NA, border ='red') See sf Vignette #3's section on Affine Transformations for more tricks.


Only top voted, non community-wiki answers of a minimum length are eligible