Package 'scgraph'

Title: Common Forms for Graph Structures
Description: Provides support for the 'silicate' common form data structure for igraph.
Authors: Michael D. Sumner [aut, cre]
Maintainer: Michael D. Sumner <[email protected]>
License: GPL-3
Version: 0.0.1.9003
Built: 2024-11-16 04:20:32 UTC
Source: https://github.com/hypertidy/scgraph

Help Index


Convert to tidygraph.

Description

Convert to tidygraph.

Usage

## S3 method for class 'SC'
as_tbl_graph(x, ...)

## S3 method for class 'sf'
as_tbl_graph(x, ...)

Arguments

x

model

...

other args

Examples

library(tidygraph)
library(scgraph)
data("minimal_mesh", package = "silicate")
as_tbl_graph(minimal_mesh)
library(silicate)  
umodel <- SC(as_tbl_graph(minimal_mesh))
#gibble.PATH <- function(x, ...) {
#inner_join(x[["path"]], x[["path_link_vertex"]] %>% group_by(path) %>% summarize(nrow = n()) ) %>%
#  dplyr::mutate(ncol = 2, type = "MULTILINESTRING")
#}
#library(gibble)
#geomap <- gibble(prim %>% PATH())
#silicate:::build_sf()
## some kind of round trip

Convert model to a graph.

Description

Only segments from an input model are extracted and used to build the graph.

Usage

## S3 method for class 'SC'
as.igraph(x, ..., layout = TRUE)

## S3 method for class 'sf'
as.igraph(x, ..., layout = TRUE)

sc_as_igraph(x, ..., layout = TRUE)

## S3 method for class 'SC0'
as.igraph(x, ..., layout = TRUE)

Arguments

x

input model

...

arguments passed to methods

layout

keep the input vertex coordinates x-y as the graph layout, defaults to 'TRUE' otherwise no layout is provided ## sf ## spatstat ## raw track data ## make up segments starting with the unjoin thing, that might show the way forward

Examples

data("minimal_mesh", package = "silicate")
as.igraph(minimal_mesh)

SC

Description

tbl_graph methods for the universal model

Usage

## S3 method for class 'tbl_graph'
SC(x, ...)

Arguments

x

input model

...

arguments passed to methods