This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(igraph) | |
library(dplyr) | |
# Assume you have a dataframe "objects" with columns "object_id", "artist_id", "date" | |
# Create an identical table that just gives a new variable name to "artist_id" | |
flipped_objects <- objects %>% rename(artist2_id = artist_id) | |
# Join the tables together (essentially joining objects to itself, creating every combination | |
# of artist that share an object_id and date | |
edges <- objects %>% |