Create points from coordinates. st_point is simply a wrapper around st_makepoint.

st_makepoint(x, y)

st_point(x, y)

Arguments

x

Numeric vector of x coordinates (e.g. longitude) or a list of pairs of coordinates. In the latter case y can be missing.

y

Numeric vector of y coordinates (e.g. latitude).

Value

List column of points with the same length than x and y.

Details

x amd y must be of the same length. If one of the coordiantes are missing, it creates and empty point geometry.

See also

Examples

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)