format_index_ids: Format Index ids

View source: R/make_index_ids.R

format_index_idsR Documentation

Format Index ids

Description

Format Index ids

Usage

format_index_ids(g, return_list = FALSE)

Arguments

g

data.frame graph with id, inid and toindid as returned by make_index_ids with long_form=TRUE.

return_list

logical if TRUE, the returned list will include a "froms_list" element containing all from ids in a list form.

Value

list containing an adjacency matrix and a lengths vector indicating the number of connections from each node. If complete is TRUE return will also include a data.frame with an indid column and a toindid list column.

Examples

x <- sf::read_sf(system.file("extdata/new_hope.gpkg", package = "hydroloom"))

y <- add_toids(x) |>
  make_index_ids(long_form = TRUE) |>
  format_index_ids()


hydroloom documentation built on Sept. 11, 2024, 8:20 p.m.