Shiny ui.R - Ошибка в теге («div», list (…)) - не уверен, где находится ошибка
Обновление - 17.12.2012 9:00 CDT: пример был обновлен демо-данными и полным кодом.[/Обновить].
Пример данных: https://gist.github.com/4318774
Описание: яЯ играл с новым пакетом Shiny (обожаю!), но непока не понимаю ошибку, которую яя получаю, когда яrunApp("")
, Ошибка .I 'Error in tag("div", list(...)): argument is missing
Я пытаюсь создать интерактивное веб-приложение для графического исследования демографических данных. Я'используя в качестве руководства следующее:
https://gist.github.com/4026749
http://rstudio.github.com/shiny/tutorial/
сoptions(error= recover)
, Я получил:
Listening on port 8100
Error in tag("div", list(...)) : argument is missing, with no default
Enter a frame number, or 0 to exit
1: runApp("//~~my app~~")
2: tryCatch(while (TRUE) {
serviceApp(ws_env)
}, finally = {
timerCallbacks$clear()
websocket_close(ws_env)
})
3: tryCatchList(expr, classes, parentenv, handlers)
4: serviceApp(ws_env)
5: service(server = ws_env, timeout = timeout)
6: server$static(j, J$wsinfo)
7: handler(ws, header)
8: handler(ws, header)
9: local({
cacheContext$with(function() {
source(filePath, local = new.env(parent = .GlobalEnv))
})
})
10: eval.parent(substitute(eval(quote(expr), envir)))
11: eval(expr, p)
12: eval(expr, envir, enclos)
13: eval(quote({
cacheContext$with(function() {
source(filePath, local = new.env(parent = .GlobalEnv))
})
14: eval(expr, envir, enclos)
15: cacheContext$with(function() {
source(filePath, local = new.env(parent = .GlobalEnv))
})
16: func()
17: source(filePath, local = new.env(parent = .GlobalEnv))
18: withVisible(eval(ei, envir))
19: eval(ei, envir)
20: eval(expr, envir, enclos)
21: ui.R#6: shinyUI(pageWithSidebar(headerPanel("Demographics Web Demo - Eglin Data"), sidebarPanel(textInput("plot.ti
22: force(ui)
23: pageWithSidebar(headerPanel("Demographics Web Demo - Eglin Data"), sidebarPanel(textInput("plot.title", "Title:",
24: bootstrapPage(div(class = "container-fluid", div(class = "row-fluid", headerPanel), div(class = "row-fluid", sideb
25: tagList(importBootstrap(), list(...))
26: div(class = "container-fluid", div(class = "row-fluid", headerPanel), div(class = "row-fluid", sidebarPanel, mainP
27: tags$div(...)
28: tag("div", list(...))
29: div(class = "row-fluid", sidebarPanel, mainPanel)
30: tags$div(...)
31: tag("div", list(...))
32: sidebarPanel(textInput("plot.title", "Title:", "Population Pyramid of Members"), wellPanel(p(strong("Demographic o
33: div(class = "span4", tags$form(class = "well", ...))
34: tags$div(...)
35: tag("div", list(...))
36: tags$form(class = "well", ...)
37: tag("form", list(...))
38: wellPanel(p(strong("Demographic of Interest")), checkboxInput(inputId = "age_dist", label = "Age Distribution", va
39: div(class = "well", ...)
40: tags$div(...)
41: tag("div", list(...))
Я пытался выяснить, что происходит, но? CheckboxInput сделал код более точным. Это также в значительной степени прямая копия "акции» пример из RStudio (github связан выше) /
ui.R
Server.R
код:ui.R
library(shiny)
shinyUI(pageWithSidebar(
# application title
headerPanel("Demographics Web Demo - Eglin Data"),
# sidebar with controls to allow user to define graphical elements and how
# they want them displayed.
sidebarPanel(
# allow the user to write a plot Title
textInput("plot.title", "Title:", "Population Pyramid of Members"),
# allow the user to determine which demographic they want to plot
wellPanel(
p(strong("Demographic of Interest")),
checkboxInput(inputId = "age_dist", label = "Age Distribution", value = TRUE),
checkboxInput(inputId = "wealth_dist", label = "Household Wealth", value = FALSE),
checkboxInput(inputId = "home_val", label = "Home Value", value = FALSE),
checkboxInput(inputId = "ed_level", label = "Members' Education", value = FALSE),
checkboxInput(inputId = "inc_level", label = "Members' Est. Income", value = FALSE),
checkboxInput(inputId = "h_own", label = "Homeownership", value = FALSE),
),
# allow the user to determine age-bracket size. Input used in plotting
sliderInput("age_cut", "Select Size of Age Brackets:",
min= 3, max= 20, value= 5),
# allow the user to subset their demographics by age range
#sliderInput("age_sub", "Please select the age range you would like to 'zoom-in' on:",
# min= 0, max= 120, value= c(15,65)),
),
# display the appropriate graphics based on the user selections defined
# above.
mainPanel(
h3(textOutput("caption")),
conditionalPanel(condition= "input.age_dist",
plotOutput(outputId= "plot_age")),
conditionalPanel(condition= "input.wealth_dist",
plotOutput(outputId= "plot_wealth")),
conditionalPanel(condition= "input.home_val",
plotOutput(outputId= "plot_home_value")),
conditionalPanel(condition= "input.ed_level",
plotOutput(outputId= "plot_edu")),
conditionalPanel(condition= "input.inc_level",
plotOutput(outputId= "plot_inc")),
conditionalPanel(condition= "input.h_own",
plotOutput(outputId= "plot_h_own"))
)
))
server.R
# require packages
if (!require(ggplot2)) {
stop("This application requires ggplot2. To install it, please run 'install.packages(\"ggplot2\")'.\n")
}
if (!require(plotrix)) {
stop("This application requires plotrix. To install it, please run 'install.packages(\"plotrix\")'.\n")
}
library(shiny)
# load example demo data
load("~~you'll need to load the test data here")
shinyServer(function(input, output) {
# reactive function based on user input for plot title
# This function is automatically called to update the display
output$caption