Related
I have a data looks like this
df<- structure(list(14, FALSE, c(1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12,
13, 6), c(0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 0), c(0, 1, 2,
3, 4, 12, 5, 6, 7, 8, 9, 10, 11), c(0, 1, 2, 3, 4, 12, 5, 6,
7, 8, 9, 10, 11), c(0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13), c(0, 6, 6, 6, 6, 6, 6, 13, 13, 13, 13, 13, 13, 13, 13
), list(c(1, 0, 1), structure(list(), names = character(0)),
list(name = c("Bestman", "Tera1", "Tera2", "Tera3", "Tera4",
"Tera5", "Tetra", "Brownie1", "Brownie2", "Brownie3", "Brownie4",
"Brownie5", "Brownie6", "Brownie7")), list()), <environment>), class = "igraph")
I am trying to make a list and assign the two core as root
I can easily do this
as_tbl_graph(df) %>%
activate(nodes) %>%
mutate(type = ifelse(name %in% c("Bestman", "Tetra"), "root", "branch")) %>%
mutate(group = ifelse(name == "Bestman" | grepl("Tera", name),
"Bestman", "Tera"))
when the number of core grows, this method does not work, for example if I have more and I do the following
for example when my data becomes like this
df2<-structure(list(28, FALSE, c(1, 2, 3, 4, 5, 6, 1, 2, 8, 7, 9,
10, 11, 7, 7, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 26,
27, 7, 12, 18, 25, 12, 18, 25, 18, 25, 25), c(0, 0, 0, 0, 0,
0, 0, 0, 7, 6, 7, 7, 7, 2, 1, 12, 12, 12, 12, 12, 18, 18, 18,
18, 18, 18, 25, 25, 0, 0, 0, 0, 7, 7, 7, 12, 12, 18), c(6, 0,
7, 1, 2, 3, 4, 5, 28, 14, 13, 9, 8, 10, 11, 12, 29, 32, 15, 16,
17, 18, 19, 30, 33, 35, 20, 21, 22, 23, 24, 25, 31, 34, 36, 37,
26, 27), c(6, 0, 7, 1, 2, 3, 4, 5, 28, 29, 30, 31, 14, 13, 9,
8, 10, 11, 12, 32, 33, 34, 15, 16, 17, 18, 19, 35, 36, 20, 21,
22, 23, 24, 25, 37, 26, 27), c(0, 0, 2, 4, 5, 6, 7, 8, 12, 13,
14, 15, 16, 18, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30, 31, 32,
36, 37, 38), c(0, 12, 13, 14, 14, 14, 14, 15, 22, 22, 22, 22,
22, 29, 29, 29, 29, 29, 29, 36, 36, 36, 36, 36, 36, 36, 38, 38,
38), list(c(1, 0, 1), structure(list(), names = character(0)),
list(name = c("Bestman", "Tera1", "Tera2", "Tera3", "Tera4",
"Tera5", "Brownie2", "Tetra", "Brownie1", "Brownie3", "Brownie4",
"Brownie5", "trueG", "ckage1", "ckage2", "ckage3", "ckage4",
"ckage5", "Carowner", "Hoghet1", "Hoghet2", "Hoghet3", "Hoghet4",
"Hoghet5", "Hoghet6", "Bestwomen", "Esme2", "Esme3")), list()),
<environment>), class = "igraph")
as_tbl_graph(df2) %>%
activate(nodes) %>%
mutate(type = ifelse(name %in% c("Bestman", "Tetra", "trueG", "Carowner","Bestwomen"), "root", "branch")) %>%
mutate(group = ifelse(name == "Bestman" | grepl("Tetra", name) | grepl("trueG",name) | grepl("Carowner", name) | grepl("Bestwomen", name) , "Bestman", "Tetra","trueG","Carowner","Bestwomen" ))
I get error, I want to know what I am doing wrong here ?
Your second graph is more complex than your first. Some of the 'peripheral' nodes join more than one central node, so it is not clear how they should be labelled / colored. However, tidygraph has various grouping functions which can be used to assign the nodes to groups based on their connectivity, and the centrality of a node can be calculated automatically to help with labelling and sizing.
library(tidygraph)
library(ggraph)
df2 %>%
as_tbl_graph() %>%
activate(nodes) %>%
mutate(is_central = centrality_hub() > 0.6) %>%
mutate(group = factor(group_label_prop())) %>%
ggraph(layout = "igraph", algorithm = "nicely") +
geom_edge_link(width = 2, alpha = 0.1) +
geom_node_circle(aes(r = ifelse(is_central, nchar(name)/12, 0.1), fill = group),
color = NA) +
geom_node_text(aes(label = ifelse(is_central, name, '')), size = 5,
color = "gray40", family = "Roboto Condensed", fontface = 2) +
theme_graph() +
coord_equal() +
scale_fill_brewer(palette = "Pastel2", guide = "none")
ifelse only allows for two options, try using dplyr::case_when instead.
https://dplyr.tidyverse.org/reference/case_when.html
Update to add requested code:
mutate(group = dplyr::case_when(name == "Bestman" ~ "Bestman",
grepl("Tetra", name) ~ "Tetra",
grepl("trueG",name) ~ "trueG",
grepl("Carowner", name) ~ "Carowner",
grepl("Bestwomen", name) ~ "Bestwomen"))
What is the correct test to evaluate the difference between 3 RX readers of the same 50 patients? The rx outcome is a categorical value with 4 ordered levels. The 3 reader have read the RX at the same time.
May I use a mixed model for paired data with patients as random effect?
I'm really in difficulty...
I've tried the repolr package for repeated ordinal scores:
repolr(formula = rsna ~ factor(reader) ,
subjects = "Patient" , data = mydata ,
categories = 4, times=c(1,2,3), po.test=TRUE,fixed=FALSE)
but I obtain this error:
Error in ord.expand(space = space, formula = formula, times = times, poly = poly, :
data: model frame and formula mismatch in model.matrix()
Here are the data:
mydata<- data.frame(Patient = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50),
reader = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
rsna = c(1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 4, 4, 4, 2, 1, 3, 2, 1, 1, 1, 2, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 4, 2, 2, 1, 1))
rsna is my outcome with 4 levels, Patients are the 50 patients, reader are the 3 readers.
How can I fix it?
If you turn the reader variable into a factor in the dataset first, it works:
mydata<- data.frame(Patient = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50),
reader = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
rsna = c(1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 4, 4, 4, 2, 1, 3, 2, 1, 1, 1, 2, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 4, 2, 2, 1, 1))
mydata$reader <- as.factor(mydata$reader)
library(repolr)
repolr(formula = rsna ~ reader,
subjects = "Patient" , data = mydata ,
categories = 4, times=c(1,2,3), po.test=TRUE,fixed=FALSE)
#>
#> repolr: 2016-02-26 version 3.4
#>
#> Call:
#> repolr(formula = rsna ~ reader, subjects = "Patient", data = mydata,
#> times = c(1, 2, 3), categories = 4, po.test = TRUE, fixed = FALSE)
#>
#> Coefficients:
#> cuts1|2 cuts2|3 cuts3|4 reader2 reader3
#> 1.1761 2.1395 2.9071 0.6600 -0.4768
Created on 2022-06-07 by the reprex package (v2.0.1)
I have the following vector:
v<-c(1, 1, 8, 3, 1, 9, 4, 21, 13, 13, 1, 1, 3, 10, 1, 13, 22, 1,
1, 4, 2, 1, 13, 1, 5, 1, 2, 1, 1, 2, 12, 10, 26, 15, 2, 9, 6,
5, 1, 3, 18, 2, 10, 2, 8, 9, 4, 1, 11, 4, 2, 12, 3, 14, 2, 1,
27, 3, 6, 2, 1, 1, 3, 16, 3, 36, 13, 9, 11, 10, 24, 2, 27, 4,
4, 2, 9, 1, 3, 13, 3, 1, 8, 5, 5, 15, 1, 1, 3, 1, 4, 14, 8, 1,
1, 2, 20, 1, 9, 3, 1, 2, 5, 14, 5, 11, 1, 3, 2, 9, 10, 21, 9,
1, 20, 5, 11, 23, 2, 1, 1, 2, 1, 7, 2, 9, 1, 19, 9, 9, 2, 15,
17, 8, 11, 17, 2, 14, 2, 8, 13, 1, 2, 9, 15, 25, 3, 8, 32, 4,
11, 1, 1, 2)
I would like to estimate its density in R through the command density. With few lines of code:
d<-density(v)
df<-data.frame(x=d$x,y=d$y,stringsAsFactors = FALSE)
plot(df)
I obtained the following picture:
But the resulting plot doesn't add up, because max(v) is 36 and min(v) is 1 while the graph shows tails before and after 0 and 40.
I have three different graphs that were produced by igraph package and graph_from_adjacency_matrix function. How can I store all three of these (g1, g2, g3) in one object so that later I can use this object as an input for another function. I want to preserve all the attributes of the graphs.
Here's the structure of the three graphs:
dput(g1)
structure(list(11, FALSE, c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2,
3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7,
8, 9, 10, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 7, 8, 9, 10, 8,
9, 10, 9, 10, 10), c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9),
c(0, 1, 10, 2, 11, 19, 3, 12, 20, 27, 4, 13, 21, 28, 34,
5, 14, 22, 29, 35, 40, 6, 15, 23, 30, 36, 41, 45, 7, 16,
24, 31, 37, 42, 46, 49, 8, 17, 25, 32, 38, 43, 47, 50, 52,
9, 18, 26, 33, 39, 44, 48, 51, 53, 54), c(0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54), c(0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45,
55), c(0, 10, 19, 27, 34, 40, 45, 49, 52, 54, 55, 55), list(
c(1, 0, 1), structure(list(), .Names = character(0)),
list(name = c("jpm", "gs", "ms", "bofa", "schwab", "brk",
"wf", "citi", "amex", "spgl", "pnc")), list(wt = c(10000,
3.16222797634994, 10000, 10000, 6.2838498029626, 1.93361060894155,
10000, 10000, 5.84323225364297, 7.44026659903325, 1.31111055012301,
10000, 10000, 4.30459269702548, 2.20457094344212, 3.49673898163627,
3.09239540712491, 3.43107254995375, 10000, 5.64499596383733,
10000, 10000, 3.72116985462354, 2.70273403225818, 2.35839869470134,
10000, 10000, 10000, 1.83130016032325, 1.99399002493476,
1.7644293974645, 1.88708226743269, 7.73257077502946,
10000, 10000, 10000, 10000, 10000, 10000, 10000, 6.94406536133693,
3.32018490900407, 2.0759886748923, 4.11734201102576,
6.193275571549, 2.85404877010956, 10000, 3.01093189825944,
10000, 10000, 7.07193471387249, 10000, 5.19453928016632,
10000, 10000))), <environment>), class = "igraph")
dput(g2)
structure(list(11, FALSE, c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2,
3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7,
8, 9, 10, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 7, 8, 9, 10, 8,
9, 10, 9, 10, 10), c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9),
c(0, 1, 10, 2, 11, 19, 3, 12, 20, 27, 4, 13, 21, 28, 34,
5, 14, 22, 29, 35, 40, 6, 15, 23, 30, 36, 41, 45, 7, 16,
24, 31, 37, 42, 46, 49, 8, 17, 25, 32, 38, 43, 47, 50, 52,
9, 18, 26, 33, 39, 44, 48, 51, 53, 54), c(0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54), c(0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45,
55), c(0, 10, 19, 27, 34, 40, 45, 49, 52, 54, 55, 55), list(
c(1, 0, 1), structure(list(), .Names = character(0)),
list(name = c("jpm", "gs", "ms", "bofa", "schwab", "brk",
"wf", "citi", "amex", "spgl", "pnc")), list(wt = c(1.72565213162016,
10000, 10000, 10000, 2.60988018061569, 3.37529546067647,
5.68789870362681, 2.44357606642214, 4.38114633403004,
10000, 10000, 2.49869325166531, 10000, 10000, 4.56956459390346,
3.52409742807134, 2.97961673322383, 3.42809851201881,
3.15481552530237, 7.32112737506667, 10000, 7.0852416616783,
3.99494740752879, 2.65955867194822, 10000, 10000, 10000,
10000, 5.73934520134914, 1.80740569361977, 1.5783164909029,
2.84567417160359, 10000, 10000, 10000, 10000, 5.30260309989479,
10000, 10000, 10000, 10000, 7.06161817483184, 6.9222112543713,
4.63691541477454, 3.48797079504012, 6.38029319494032,
10000, 2.48116694808653, 10000, 2.12352867446693, 3.04335319291233,
10000, 10000, 5.22409020671212, 10000))), <environment>), class = "igraph")
dput(g3)
structure(list(11, FALSE, c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2,
3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 7,
8, 9, 10, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 7, 8, 9, 10, 8,
9, 10, 9, 10, 10), c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4,
4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9),
c(0, 1, 10, 2, 11, 19, 3, 12, 20, 27, 4, 13, 21, 28, 34,
5, 14, 22, 29, 35, 40, 6, 15, 23, 30, 36, 41, 45, 7, 16,
24, 31, 37, 42, 46, 49, 8, 17, 25, 32, 38, 43, 47, 50, 52,
9, 18, 26, 33, 39, 44, 48, 51, 53, 54), c(0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
51, 52, 53, 54), c(0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45,
55), c(0, 10, 19, 27, 34, 40, 45, 49, 52, 54, 55, 55), list(
c(1, 0, 1), structure(list(), .Names = character(0)),
list(name = c("jpm", "gs", "ms", "bofa", "schwab", "brk",
"wf", "citi", "amex", "spgl", "pnc")), list(wt = c(10000,
4.14221420842333, 2.69857209553848, 5.77115055524614,
1.95672007809809, 2.98690863617922, 1.92161847347613,
2.34571882319417, 10000, 10000, 1.97201563662035, 5.4078452590091,
10000, 6.85345421615961, 3.51453278996926, 10000, 10000,
2.08964950396744, 10000, 2.78868220464486, 10000, 3.41857460835555,
4.57693796722718, 1.96044036389548, 10000, 6.69365386837721,
2.61525679780493, 7.34195637377719, 2.57334862699097,
3.54317409176484, 10000, 2.33889236077345, 2.49271973693215,
5.47858809426897, 10000, 5.25238753114071, 10000, 10000,
10000, 10000, 10000, 2.68400716970295, 2.49075030691088,
2.59993683645561, 10000, 10000, 2.49345951327313, 5.7338881554994,
1.73687483250752, 4.24032760636804, 3.11756167665892,
5.07827243244947, 10000, 1.69643890905687, 10000))),
<environment>), class = "igraph")
I think you can try list like below
g <- list(g1,g2,g3)
I would like to pass the information I have to a normal list of axes with nodes but I don't know how to do it. The raw data with "deput" would look like this. If someone knows how to convert this list into something easier to use I would appreciate it.I can visualise the graph with "plot" but to edit it I need to have more precise information.
library(igraph)
dput (net2$graph_pajek)
structure(list(30, FALSE, c(1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 6, 7, 13, 13,
14, 15, 16, 18, 20, 20, 21, 27, 27, 27, 27, 29, 2, 2, 2, 2, 2,
2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 12, 12, 12,
13, 13, 13, 14, 14, 14, 15, 15, 15, 16, 18, 18, 18, 19, 20, 20,
21, 21, 23, 24, 25, 26, 27, 27, 27, 29, 3, 3, 3, 3, 3, 3, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5,
5, 5, 5, 5, 6, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10,
10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 15), list(c(1, 0, 1), structure(list(), .Names = character(0)),
list(name = c("A", "B", "C",
"D", "E", "F", "G", "H",
"I", "J", "K",
"L", "M", "N",
"O", "P", "Q", "R",
"S", "T", "U",
"V", "W", "X", "Y", "Z",
"AB", "AC", "AD", "AE"
), deg = c(248, 532, 855, 574, 1761, 261, 229, 216, 554,
628, 774, 223, 502, 295, 266, 910, 227, 312, 364, 260, 294,
741, 227, 471, 392, 376, 292, 295, 212, 287), size = c(2.,
6, 9, 6, 20,
2, 2, 2, 6,
7, 8, 2, 7,
3, 3, 10, 2,
3, 4, 2, 3.,
8, 2, 5, 4,
4, 3, 3, 2,
3), label.cex = c(0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7
), id = c("A", "B", "C",
"D", "E", "F", "G", "H",
"I", "J", "K",
"L", "M", "N",
"O", "P", "Q", "R",
"S", "T", "U",
"V", "W", "X", "Y", "Z",
"AB", "AC", "AD", "AE"
)), list(num = c(4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 3, 3, 3,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 3, 3, 3, 1, 1, 2,
2, 1, 1, 1, 1, 2, 2, 1, 4, 4, 4, 4, 1, 7, 7, 7, 7, 7, 7,
7, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 1, 2, 2, 1, 2, 2, 3, 3, 3, 5, 5, 5, 5, 5, 2,
2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 1, 2,
2, 2, 2, 1, 1, 1, 1, 3, 3, 3, 1, 6, 6, 6, 6, 6, 6, 40, 40,
40, 40, 40, 40, 40, 40, 40), weight = c(4, 4, 4, 4,
7, 7, 7, 7, 7, 7, 7, 3, 3, 3, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 3, 3, 3, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 4,
4, 4, 4, 1, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 2, 2, 1, 2, 2,
3, 3, 3, 5, 5, 5, 5, 5, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 1, 3, 3, 3, 1, 2, 2, 2, 2, 1, 1, 1, 1, 3, 3, 3,
1, 6, 6, 6, 6, 6, 6, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
40, 7, 7, 7, 7, 7, 7, 7, 1, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7,
4, 4, 4, 4, 4, 4, 4, 4, 1, 18, 18))), <environment>), class = "igraph")
Are you looking for something like get.data.frame
> get.data.frame(net)
from to weight
1 A B 0.63502922
2 B C 0.79410173
3 C D 0.90802625
4 D E 0.09408188
5 E F 0.16450634
6 F G 0.75931882
7 G H 0.30409658
8 H I 0.23990324
9 I J 0.84762277
10 A J 0.88657718
data
Since I cannot reproduce the example in your post, I created a dummy example net like below
net <- make_ring(10) %>%
set_vertex_attr(name = "name", value = LETTERS[1:vcount(.)]) %>%
set_edge_attr(name = "weight", value = runif(ecount(.)))
To clarify a couple things:
The igraph file is not a plot per se, but a graph structure (as in, nodes and edges).
igraph has functions for plotting graphs, but there is no single and standard way of plotting a graph - instead, different algorithms can be used to determine visually-ideal ways of displaying them, and these algorithms oftentimes rely on random initializations.
The outputs from the plotting functions of igraph are only relevant in terms of R base plot drawing logic, AFAIK they don't use an intermediate format with coordinates handled in a user-comprehensible structure. You can nevertheless manage lots of aspects of how they are drawn - see ?igraph::igraph.plotting.