st_point.Rd
Create points from coordinates. st_point
is simply a wrapper around st_makepoint
.
st_makepoint(x, y) st_point(x, y)
x | Numeric vector of x coordinates (e.g. longitude) or a list of pairs
of coordinates. In the latter case |
---|---|
y | Numeric vector of y coordinates (e.g. latitude). |
List column of points with the same length than x
and y
.
x
amd y
must be of the same length. If one of the coordiantes are
missing, it creates and empty point geometry.
Other make: st_makeline
,
st_multi
, st_numpoints
library(tibble) library(dplyr) df <- tibble(longitude = -71.1043, latitude = 42.3150) df %>% mutate(geometry = st_point(longitude, latitude))#> # A tibble: 1 x 3 #> longitude latitude geometry #> <dbl> <dbl> <POINT> #> 1 -71.1 42.3 (-71.1043 42.315)