Skip to content
This repository has been archived by the owner on Jul 28, 2019. It is now read-only.
/ projectoR Public archive

Function to project a bipartite edgelist into a unipartite one

License

Notifications You must be signed in to change notification settings

mdlincoln/projectoR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

projectR

Install

# install.packages("devtools")
devtools::install_github("mdlincoln/projectoR")

Usage

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.

library(projectoR)

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

project_table(bipartite_list, joining_col = "student")
#>     from   to weight
#> 1 Karate Book      2

Matthew Lincoln

About

Function to project a bipartite edgelist into a unipartite one

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages