首页 > 解决方案 > UseMethod 中的 Plotly/orca 错误(“plotly_build”)

问题描述

我正在尝试使用保存在 R(studio) 中使用名为 admixtools 的程序制作的图表。我能够绘制图表 ( plotly_graph(newgraph)),但我无法保存它(svg/pdf/png 等)。我可以手动从 Rstudio 中保存绘图,但我有太多的事情要做。当我尝试保存图表时orca(newgraph, "newgraph.svg"),出现错误:

UseMethod(“plotly_build”)中的错误:没有适用于“plotly_build”的方法应用于“igraph”类的对象

有任何想法吗?!?非常感谢!


devtools::install_github("uqrmaie1/admixtools")
install.packages("plotly")

library("admixtools")
library("orca")
library("plotly")

mypops = c('pop1',  'pop2', 'pop3')
pops = mypops

newgraph = random_admixturegraph(pops, numadmix = 0, outpop = 'pop1')
plotly_graph(newgraph)

# THE ABOVE WORKS FINE SO THERE IS NO PROBLEM WITH THE ADMIXTOOLS PART TO MAKE THE GRAPH

在此处输入图像描述

# INSTALLED ORCA AS DESCRIBED HERE: https://github.com/plotly/orca#installation (Mac OS) and added to my path fine
# The following results in the error:
# Error in UseMethod("plotly_build") : no applicable method for 'plotly_build' applied to an object of class "igraph

orca(newgraph, "newgraph.svg")

标签: rplotlyorca

解决方案


推荐阅读