project_table: Project a bimodal edge list into a unimodal edge list

Description Usage Arguments Value Examples

View source: R/project_table.R

Description

This function takes a table with an edge list, where the first two columns describe the source and target vertices/nodes of multiple edges. It will return an edge list of a projected network with the joining_col vertices removed.

Usage

1
project_table(df, joining_col)

Arguments

df

A data.frame with the oribinal bimodal edge list

joining_col

The quoted name of the column with the node ids that will be removed from the projected graph

Value

A data.frame edgelist with the columns from and to each containing IDs from joining_col, along with a weight column.

Examples

1
2
3
4
5
6
7
8
9
bipartite_list <- data.frame(
  club = c("Karate", "Karate", "Book", "Chess", "Book", "Chess"),
  student = c(1, 2, 1, 3, 2, 4),
  stringsAsFactors = FALSE)

project_table(bipartite_list, joining_col = "club")
#>   from to weight
#> 1    1  2      2
#> 2    3  4      1

mdlincoln/projectoR documentation built on May 22, 2019, 4:16 p.m.