rRharts 在 Rstudio 和浏览器中显示,但在 R 查看器中不显示

rRharts shows in Rstudio and browser but not R viewer

早安社区,

我想问一个关于 rCharts 图形输出与原生 R 相比的快速问题。

问题 1:为什么来自 rCharts 的图表显示在我的浏览器中而不是 R 中的查看器中?

问题 2:如何强制(或选择使用)原生 R 中的绘图函数?

查看这两个屏幕截图:

原生 R 代码:

# Simple Scatterplot
attach(mtcars)
plot(wt, mpg, main="Scatterplot Example", 
    xlab="Car Weight ", ylab="Miles Per Gallon ", pch=19)

rChart 代码:

library(rCharts)

myData

plot<-Highcharts$new()
plot$chart(polar = TRUE, type = "line",height=NULL)
plot$xAxis(categories=myData$Subject.ID, tickmarkPlacement= 'on', lineWidth=1)
plot$yAxis(gridLineInterpolation= 'circle', lineWidth=1, min=NULL,max=NULL,endOnTick=T,tickInterval=10)
plot$series(data = myData[,"A"],name = "A", pointPlacement="on")
plot

r使用的图表数据

   Subject.ID  A  B  C
1           1 65 29 60
2           2 87 67 59
3           3 98 54 24
4           4 67 44 23
5           5 54 50  4
6           6 83 60 54
7           7 82 55 27
8           8 80 48 32
9           9 88 56 44
10         10 68 68 56
11         11 90 76 69
12         12 41 47 45
13         13 NA 82 NA
14         14 NA 55 NA

Ps:顺便说一句,我知道我正在绘制两个不同的函数,散点图与雷达图。我的目标是了解原生 R 是否可以显示(或可能是另一个词)rCharts 的图形输出 - 即使我失去交互性。

我已经联系了 rCharts 的开发人员,他回复了我:

"The native viewer that comes with the R GUI is NOT capable of displaying html. So, the only way to view html output like what rCharts generates is to use the browser. The RStudio viewer on the other hand is capable of displaying html and so rCharts takes advantage of that."