1
運動圖表顯示在我自己的計算機上,儘管圖表顯示在另一個IE窗口而不是RStudio的內部窗口。 然而,當我使用將R閃亮服務器,以便部署在網絡的googleVis運動圖表,該錯誤消息顯示:無法使用R閃亮服務器部署googleVis運動圖表
Error: $ operator is invalid for atomic vectors
我還檢查他們使用下面的命令,它顯示了它們不是原子:
>is.recursive(Fruits)
[1] TRUE
>is.atomic(Fruits)
[1] FALSE
可複製代碼如下,我簡化了它,並使用內部數據「水果」來演示它;問題仍然存在,運動圖表沒有顯示在同一個窗口中,而是出現在IE9的另一個窗口中。 而當使用閃亮服務器部署時,它變得崇拜,運動圖根本沒有出現,並顯示相同的錯誤信息
服務器。 [R
library(googleVis)
library(shiny)
shinyServer(function(input, output) {
output$motionchart2 <- renderGvis({
M1 <- gvisMotionChart(Fruits, idvar="Fruit", timevar="Year")
plot(M1)
})
})
UI.R
library(shiny)
library(googleVis)
shinyUI(fluidPage(
titlePanel("Analysis"),
mainPanel(
navlistPanel(
tabPanel("MotionChart",h1("Motion Chart"),tableOutput("motionchart2"))
)
)
)
)
您可以張貼整個代碼,或至少足以讓一個[重複的例子(http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible例如)? – tospig
@tospig:我在下面添加了可重複的代碼,感謝您的建議。 – Samoth
我相信renderGvis需要作爲HTML輸出,所以在你的UI中,用htmlOutput(「motionchart2」)替換tableOutput。你也可以嘗試用返回(M1)替換陰謀(M1)嗎? –