st_makeline: Creates a Linestring from point, multipoint, or line...

Description Usage Arguments Value See Also Examples

View source: R/make.R

Description

Lines can be created from point aggregates (using summarise) or from – to to create a 2-vertex line.

Usage

1
st_makeline(.geom, .to, ...)

Arguments

.geom

A geometry or a set of geometries of class sfc to be converted to line. The geometries are often aggregated using a dplyr::group_by() followed by adplyr::summarise().

.to

A point geometry to create pairwise lines.

...

Unused.

Value

A line (LINESTRING) of class sfc.

See Also

Other make: st_makepoint, st_multi, st_numpoints

Examples

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

x <- tibble(g = c("a", "a"), point = c(st_point(12, 21), st_point(21, 12)))
x %>%
 summarise(line = st_makeline(point))

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