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-12-16 03:13:41 UTC |
Source: | https://github.com/hypertidy/scgraph |
Convert to tidygraph.
## S3 method for class 'SC' as_tbl_graph(x, ...) ## S3 method for class 'sf' as_tbl_graph(x, ...)
## S3 method for class 'SC' as_tbl_graph(x, ...) ## S3 method for class 'sf' as_tbl_graph(x, ...)
x |
model |
... |
other args |
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
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
Only segments from an input model are extracted and used to build the graph.
## 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)
## 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)
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 |
data("minimal_mesh", package = "silicate") as.igraph(minimal_mesh)
data("minimal_mesh", package = "silicate") as.igraph(minimal_mesh)
tbl_graph methods for the universal model
## S3 method for class 'tbl_graph' SC(x, ...)
## S3 method for class 'tbl_graph' SC(x, ...)
x |
input model |
... |
arguments passed to methods |