library(sf) nc = st_read(system.file("shape/nc.shp", package="sf")) nc <- st_transform(nc, 32119) # regular grid 512096 polygons grid <- st_make_grid(x = nc, cellsize = 500) t0 <- Sys.time() plot(st_geometry(nc)) plot(grid, add = TRUE) # end of the second plot t1 <- Sys.time() # actual display in RStudio Plots window t2 <- Sys.time() # t2 - t0 # ~ 58 secs t3 <- Sys.time() png("test.png") plot(st_geometry(nc)) plot(grid, add = TRUE) dev.off() t4 <- Sys.time() # t4 - t3 # ~ 23 secs