Tidygraph provides a tidy framework in R for all things relational (networks/graphs, trees, etc.). It is often used alongside ggraph.
Questions tagged [tidygraph]
102 questions
0
votes
1 answer
Defining a column as y-axis with tidygraph and ggraph? foodweb and network plots
community!
I have a question regarding tidygraph:: and ggraph:: packages.
I am trying to create a food web network plot (code and graph below), however, I wanted to use the kk layout with a defined y-axis, in my case the TL column from nodes_df.
I…

Bia Dias
- 23
- 3
0
votes
1 answer
How to reorder a list of tidygraph objects based on a column in the list in R?
I have a list of tidygraph objects. I am trying to reorder the list elements based on a certain criteria. That is, each element of my list has a column called name. I am trying to group together the list elements that have identical name columns...…

Electrino
- 2,636
- 3
- 18
- 40
0
votes
1 answer
Remove duplicated elements from a list of tidygraph objects in R?
I have a list of tidygraph objects. Within the node data I have two columns, i.e., name and frequency. What I'm trying to do is remove any of the list elements (i.e., tidygraph objects) that are repeated more than once. Hopefully my example can…

Electrino
- 2,636
- 3
- 18
- 40
0
votes
1 answer
Count identical columns of a matrix containing lists in R?
The data I'm dealing with is a matrix, where each column in the matrix is a list with 2 elements. What I'm trying to do is count how many of the columns are identical.
I am extracting the matrix of lists from a tidygraph object. My example below…

Electrino
- 2,636
- 3
- 18
- 40
0
votes
1 answer
Return list index from a list of tidygraph objects in R?
So, I have a list of multiple tidygraph objects and what Im trying to do is return the index a specific tidygraph object, selected by the user. Hopefully my example below will explain the problem.
(ASIDE: I have attempted a solution that I show…

Electrino
- 2,636
- 3
- 18
- 40
0
votes
1 answer
Which R object can store multiple networks?
I am new to R.
I am trying to create a loop where I create multiple networks at the same time. Something like:
#loading required packages
library(igraph)
library(tidygraph)
for (i in 1:10) {
G[i]=play_erdos_renyi(10, .2)
}
Where i-th element of G…

AC24
- 5
- 2
0
votes
2 answers
How to create a time loop for updating node attribute using igraph/tidygraph?
I am new to R.
I am trying to create a time-loop, where the value of a node attribute gets updated over time, if the nodes are not informed. So far, I have something like the following:
#loading required packages…

AC24
- 5
- 2
0
votes
1 answer
Is there a way to activate a subset of nodes using tidygraph?
I am very new to R.
I am trying to code the following using tidygraph:
V(g)$activated <- F
V(g)[seeds]$activated=T
where g is my graph, activated is the attribute I want to add, seeds is a predefined vector. I am successful in doing the first part…

AC24
- 5
- 2
0
votes
1 answer
Organize graph nodes vertically according to a 'y' value in R / ggraph
I created this little package to organize "family" data with the hope of creating genealogical trees using ggraph/tidygraph. I managed to obtain a graph like this (the data can be loaded without the package - cf. code at the…

Dominique Makowski
- 1,511
- 1
- 13
- 30
0
votes
1 answer
Specify which node is the root in simple sfnetworks
I have a rooted tree with spatially explicit edges that consists of just one edge and two nodes.
Data
n01 = st_sfc(st_point(c(0, 0)))
n02 = st_sfc(st_point(c(0, 10)))
from = c(1)
to = c(2)
nodes = st_as_sf(c(n01, n02))
edges = data.frame(from =…

Josh J
- 395
- 1
- 3
- 13
0
votes
1 answer
How to export SHP file after Spatial networks in R with sf and tidygraph
I have worked with centrality calculation from the OSM database. I followed the instruction (link) .
However, I want to export the shapefile of the street network that carries centralities values. I am new to R. So I am not sure what part is used as…
0
votes
1 answer
Network Dendrogram Levels do not Add Up
I am working with a large network with thousands of nodes and edges to consider. A reprex of the network can be found in a previous question here Number of Connected Nodes in a dendrogram
However, when calculating the number of nodes within the…

James Crumpler
- 192
- 1
- 8
0
votes
0 answers
projecting dynamic bi-partite/two-mode network where only edges overlapping in time is kept
I am attempting to create a one-mode network of co-workers based on a bi-partite graph. I have a dataset consisting of people and the companies they worked at, plus the year they started and ended their time at any given company.
I want to project…

samitakamaki
- 3
- 3
0
votes
1 answer
How do I setup data for tidygraph and ggraph?
I'm wanting to run a network analysis but am completely lost at how to get my data structured correctly, since most examples already have data structured at the to and from level.
An example of my data looks like:
df <- data.frame(Name = c("Alice",…

user2716568
- 1,866
- 3
- 23
- 38
0
votes
1 answer
Is there a way to generate a random network with attributes?
So I would like to evaluate homophily against a random network. This means I need to create a random network with the attributes that I am interested in. Getting the random network is easy enough, but I can't add attributes because the random…

EBrewe
- 113
- 10