st_rect

st_rect(range, crs = st_crs(4326))

Arguments

range

[lon_min, lon_max, lat_min, lat_max]

Examples

if (FALSE) { # \dontrun{
xlim <- c(112, 115)
ylim <- c(21, 23)
range <- c(xlim, ylim)
poly <- st_rect(range)
write_sf(poly, "poly.shp")
} # }