光沢のあるアプリに ggvis コードを組み込むのに苦労しています。Web 上で説明が見つからないエラーが表示されます。エラーは次のとおりです。
Error : No data supplied to mark.
誰かが私が間違っていることを教えてください。ありがとう!
ui.R:
shinyUI(pageWithSidebar(
headerPanel("test"),
sidebarPanel(
fileInput("INPUT","Upload your .xls:")
),
mainPanel(
ggvisOutput("PLOT")
)
))
サーバー.R:
library(ggvis)
shinyServer(function(input, output, session) {
PLOTDF<-reactive({
if (is.null(input$INPUT)==F) {
library(gdata)
tax<-read.xls(input$INPUT$datapath,check.names=F)
plotdf<-data.frame(c(tax[1,1],tax[1,2]),c(tax[2,1],tax[2,2]))
colnames(plotdf)<-c("a","b")
plotdf
}
})
reactive({
plotdf_read<-PLOTDF()
plotdf_read$data %>% ggvis(x=~a,y=~b) %>% layer_points()
}) %>% bind_shiny("PLOT")
})