我是R的新手,很闪亮,正尝试使用gapminder数据发布一个小型应用程序。该应用程序在本地运行良好,但是在发布到shinyapps.io时出错。最初,我认为它不是从库中获取数据,而是将其移动到目录中的csv,但这并没有做任何事情。 预先感谢。
编辑:还有另一个消息框,指出布局无效,但无论如何我还是要继续。
#test data to play with
#library(gapminder)
library(dplyr)
gapminder <- read.csv("gapminder_data.csv")
gapminder$country <- factor(gapminder$country)
#actual shiny work
library(shiny)
# Define User Inerface for application
#themes, objects and features are put here
ui <- fluidPage(sidebarLayout(
sidebarPanel(
h4("Plot parameters"),
textInput("title", "Plot Title", "Life Expectancy Over Time"),
numericInput("num", "Number of years to show", 30, 1, nrow(gapminder)),
sliderInput("size", "Point size", 1, 5, 2, 0.5),
selectInput("country", "Select a country", choices=levels(factor(gapminder$country)),selected="Togo")
),
mainPanel(
plotOutput("plot"),
tableOutput("table")
)
))
# function that will output results to the html page
server <- function(input, output) {
df_out <- reactive(subset(gapminder,country==input$country))
output$plot <- renderPlot({
plot(x=df_out()$year[1:input$num],y=df_out()$lifeExp[1:input$num], main = input$title, cex = input$size)
})
}
#output$table <- renderTable({})
# Run the application
shinyApp(ui = ui, server = server)
会议信息:R版本3.6.1(2019-07-05)平台: x86_64-w64-mingw32 / x64(64位)在以下环境下运行:Windows 10 x64(build 18362)
Matrix产品:默认
语言环境:[1] LC_COLLATE = English_United States.1252 [2] LC_CTYPE = English_United States.1252 [3] LC_MONETARY = English_United States.1252 [4] LC_NUMERIC = C [5] LC_TIME =英语_美国。1252
附加的基本软件包:[1]统计图形grDevices utils
通过名称空间(未附加)加载的
数据集方法基础:[1] Compiler_3.6.1
rsconnect_0.8.15 Cookies:[1]“无” GET / v1 / applications /?filter = account_id:379483&filter = name:shiny_notes&count = 100&offset = 0 199毫秒 -----捆绑上传于2019-12-01 23:07:13开始----- [2019-12-01 23:07:13]推断App模式和参数 -----部署错误----- inferAppPrimaryDoc(appPrimaryDoc = appPrimaryDoc,appFiles = appFiles,错误:应用程序模式静态需要至少一个文档。调用:... withStatus-> 强制-> bundleApp-> inferAppPrimaryDoc