當我使用Shiny運行rCharts時,只有陰謀的頂部顯示在我的本地控制檯中。我完全不知道爲什麼這樣,我正在運行rCharts和Shiny的最新開發版本。任何幫助將不勝感激!rcharts nplot僅在運行閃亮時顯示陰謀的頂部
以下兩個文件應完全重現該問題。在此先感謝,塞巴斯蒂安
## server.R
require(rCharts)
library(RCurl)
options(RCHART_WIDTH = 800)
shinyServer(function(input, output) {
output$myChart <- renderChart({
x <- getURL("https://raw.github.com/sebastianbarfort/vaa/master/vaa_.csv")
df___ <- read.csv(text = x)
p2 <- nPlot(Economy ~ Immigration, group = 'X.1', data = df___,
type = 'scatterChart')
p2$chart(color = c('red', 'blue', 'green',"yellow","yellow","yellow","yellow","yellow"))
p2$set(dom = "myChart")
return(p2)
})
})
##ui.R
require(rCharts)
shinyUI(pageWithSidebar(
headerPanel("xxx"),
sidebarPanel(
selectInput(inputId = "x",
label = "Choose X",
choices = c("CL", "Economy", "Education", "Envrionment", "EU",
"FP", "Health", "Immigration"),
selected = "Economy"),
selectInput(inputId = "y",
label = "Choose Y",
choices = c("CL", "Economy", "Education", "Envrionment", "EU",
"FP", "Health", "Immigration"),
selected = "Immigration")
),
mainPanel(
showOutput("myChart","Nvd3")
)
))
在加載的情況下從GitHub的CSV失敗(這應該是不可能,如果您加載RCurl),這裏是直接鏈接到該數據在Github上: https://github.com/sebastianbarfort/vaa/blob/master/vaa_.csv
請嘗試在另一臺計算機上運行您的示例;我放棄了糾正它。第一行df__是一個剩餘的並給出錯誤。在沒有證書的計算機上,下一個df__存在安全問題;它可能與一些curl-stuff一起工作,但不是簡單的R. –
代碼現在應該工作,只要RCurl加載。如果沒有,我已經在Github上包含了一個到csv的直接鏈接。 –