st_point: Create points

Description Usage Arguments Details Value See Also Examples

Description

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

Usage

1
2
3
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).

Details

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

Value

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

See Also

sf::st_point

Other make: st_makeline, st_multi, st_numpoints

Examples

1
2
3
4
5
6
library(tibble)
library(dplyr)

df <- tibble(longitude = -71.1043, latitude = 42.3150)
df %>%
  mutate(geometry = st_point(longitude, latitude))

etiennebr/geotidy documentation built on Feb. 28, 2020, 4:45 a.m.