R:绘制图形-';x';是一个列表,但没有组件';x';和';y';
使用R,我创建了一个图形对象,并能够生成一个子图(make_ego_graph)。sub_图已成功创建,但我无法绘制此图 我已附上以下代码:R:绘制图形-';x';是一个列表,但没有组件';x';和';y';,r,plot,graph,data-visualization,R,Plot,Graph,Data Visualization,使用R,我创建了一个图形对象,并能够生成一个子图(make_ego_graph)。sub_图已成功创建,但我无法绘制此图 我已附上以下代码: library(igraph) file <-data.frame( "source" = c( "John", "John", "Tim", "Tim", "Alex", &quo
library(igraph)
file <-data.frame(
"source" = c(
"John",
"John",
"Tim",
"Tim",
"Alex",
"Andrew",
"Andrew",
"Andrew",
"Oliver",
"Oliver",
"Oliver",
"Matt",
"Steven",
"Steven",
"Steven",
"Matt",
"Charles",
"Charles",
"Charles",
"Sean",
"Ted",
"Ryan",
"Ryan",
"Ryan",
"Ted",
"Phil",
"Phil",
"Phil",
"Sam",
"Toby",
"Toby",
"Donald",
"Donald",
"Donald",
"Mitch",
"Mitch",
"Mitch"),
"target" = c("Sam",
"Tim",
"Alex",
"Matt",
"Andrew",
"Sean",
"Peter",
"Ben",
"Kevin",
"Thomas",
"Dave",
"Steven",
"Kenny",
"Derek",
"CJ",
"Charles",
"Ivan",
"Kyle",
"Andrew",
"Ted",
"Ryan",
"Daniel",
"Chris",
"Scott",
"Phil",
"Henry",
"George",
"Paul",
"Toby",
"Donald",
"Mitch",
"Jack",
"Luke",
"Myles",
"Elliot",
"Harvey",
"Owen")
)
有人能告诉我我做错了什么吗
谢谢我想起来了:
ego = make_ego_graph(graph, "John", order = 3)
a = ego[[1]]
plot(a)
#create subgraph
ego = make_ego_graph(graph, "John", order = 3)
plot(ego)
Error in xy.coords(x, y, xlabel, ylabel, log) :
'x' is a list, but does not have components 'x' and 'y'
ego = make_ego_graph(graph, "John", order = 3)
a = ego[[1]]
plot(a)