-2

我目前有一个运行良好的 R 代码,我想使用 rpy2 包在 python 中使用此代码。

代码在 R 中显示了 Sunburst:

library(sunburstR)

sequences <- read.csv(system.file("examples/visitsequences.csv",package="sunburstR"),header=F,stringsAsFactors = FALSE)

sunburst(sequences)

但是在 Python 中,当我使用 rpy2 时,我有这个:

sequences = r('read.csv(system.file("examples/visit-sequences.csv",package="sunburstR"),header=F,stringsAsFactors = FALSE)')
r('sunburst(sequences)')

事实上,它可以工作,但它没有显示图表......

你能帮我吗 ?

4

1 回答 1

0

您可以尝试使用:

 r('sun <- sunburst(sequences); print(sun)')
于 2018-07-23T11:10:56.293 回答