PATH0: Path model in structural form

Description Usage Arguments Details Value Examples

View source: R/PATH0-model.R

Description

Structural form requires only tables 'object' and 'vertex'.

Minimal columns is x,y but can be grouped by path_ for separate paths, then subobject_ and object_ for full polygon support.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
PATH0(x, ...)

## Default S3 method:
PATH0(x, ...)

## S3 method for class 'PATH0'
PATH0(x, ...)

PATH0_from_df(
  x,
  ...,
  path_ = "path_",
  object_ = "object_",
  subobject_ = "subobject_",
  x_ = "x",
  y_ = "y"
)

Arguments

x

data frame with at least x, y columns

...

ignored

path_

path identifier, these should identify individual paths

object_

object identifier (like group in ggplot)

subobject_

subobject identifier (like polygon_id with multipolygons in sfheaders)

x_

optional name for x column (assumed to be x)

y_

optional name for x column (assumed to be y)

Details

This function exists as a special-case for non-format input for PATH0(). It's expected there are columns x, y, and optionally object_, subobject_, and path_. These correspond to names in sfheaders, multipolygon_id, polygon_id, and linestring_id. (subobject is optional if not multipolygon).

Value

PATH0 model with tables 'object' and 'vertex'

Examples

1
2
3
4
(p <- PATH0(minimal_mesh))

p$object$topology_
PATH0_from_df(data.frame(x = runif(10), y = runif(10)))

Example output

Attaching package:silicateThe following object is masked frompackage:stats:

    filter

class       : PATH0
type        : Sequential
vertices    : 14 (2-space)
paths       : 3 (1-space)
coordinates : 14
crs         : NA
NULL
Warning message:
Unknown or uninitialised column: `topology_`. 
class       : PATH0
type        : Sequential
vertices    : 10 (2-space)
paths       : 1 (1-space)
coordinates : 10
crs         : NA

silicate documentation built on Nov. 13, 2020, 5:08 p.m.