Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9007457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:41:45+00:00 2026-06-16T01:41:45+00:00

Update – 12/17/2012 9am CDT : example has been updated with demo data and

  • 0

Update – 12/17/2012 9am CDT: example has been updated with demo data and full code. [/update].

Example Data: https://gist.github.com/4318774

Description:
I’ve been playing around with the new Shiny package (love it!) but don’t yet understand an error I’m getting when I runApp(""). Error is Error in tag("div", list(...)): argument is missing.

I’m trying to create an interactive web-app for graphical exploration of demographic data. I’m using the following as guides:
https://gist.github.com/4026749
http://rstudio.github.com/shiny/tutorial/

with options(error= recover), I get:

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(...))

I tried investigating what was going on, but ?checkboxInput made the code look accurate. It also is pretty much a direct copy of the “stocks” example from RStudio (github linked above)

ui.R / Server.R code:
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 <- reactiveText(function() {
    input$plot.title
  })

  updateAge_f <- reactive(function() {
    # re-define age brackets based on user input
    demos$age_f <- ordered(cut(demos$age, breaks= c(seq(0, max(demos$age), input$age_cut)),
                               include.lowest= T))
  })

  # Generate a plot of the Members' age distribution
  output$plot_age <- reactivePlot(function() { 
    # call to update age factor if needed
    updateAge_f()
    # develop input vectors
    male <- as.vector(table(demos$age_f, demos$female_flag)[,1]/summary(demos$female_flag)[1] * 100)
    women <- as.vector(table(demos$age_f, demos$female_flag)[,2]/summary(demos$female_flag)[2] * 100)
    # create plot
    pyramid.plot(lx= male, rx= women,
                 labels= levels(demos$age_f),
                 lxcol= "blue", rxcol= "pink",
                 main= "Population Pyramid of Members",
                 gap= 2, labelcex= .75)
  })

  # generate a plot of members' wealth codes
  output$plot_wealth <- reactivePlot(function() { 
    # call to update age factor if needed
    updateAge_f()

    if (input$factor_age == TRUE) {
      ggplot(demos2, aes(wealth)) + geom_bar() + 
        facet_wrap(~ age_f, ncol= 3) + theme_bw() +
        labs(title= "Wealth of Members by Age Bracket",
             y= "Count of Individuals",
             x= "Decile of Wealth (by State)") +
        theme(axis.text.x= element_text(angle= 90))
    } else if (input$factor_age == FALSE) {
      ggplot(demos2, aes(wealth)) + geom_bar() + 
        theme_bw() +
        labs(title= "Wealth of Members of your Members",
             y= "Count of Individuals",
             x= "Decile of Wealth (by State)") +
        theme(axis.text.x= element_text(angle= 90))
    }
  })

  # generate a plot of home value of members' properties
  output$plot_home_value <- reactivePlot(function() { 
    # call to update age factor if needed
    updateAge_f()

    if (input$factor_age == TRUE) {
      ggplot(demos2, aes(home_value)) + geom_bar() + 
        facet_wrap(~ age_f, ncol= 3) + theme_bw() +
        labs(title= "Home Value by Age Bracket",
             y= "Count of Individuals",
             x= "Home Value") +
        theme(axis.text.x= element_text(angle= 90))
    } else if (input$factor_age == FALSE) {
      ggplot(demos2, aes(home_value)) + geom_bar() + 
        theme_bw() +
        labs(title= "Home Value of your Members",
             y= "Count of Individuals",
             x= "Home Value") +
        theme(axis.text.x= element_text(angle= 90))
    }
  })

  # generate a plot of education distribution
  output$plot_edu <- reactivePlot(function() { 
    # call to update age factor if needed
    updateAge_f()

    if (input$factor_age == TRUE) {
      ggplot(demos2, aes(ed_code)) + geom_bar() + 
        facet_wrap(~ age_f, ncol= 3) + theme_bw() +
        labs(title= "Education Level by Age Bracket",
             y= "Count of Individuals",
             x= "Education Level") +
        theme(axis.text.x= element_text(angle= 90))
    } else if (input$factor_age == FALSE) {
      ggplot(demos2, aes(ed_code)) + geom_bar() + 
        theme_bw() +
        labs(title= "Education Level of your Members",
             y= "Count of Individuals",
             x= "Education Level") +
        theme(axis.text.x= element_text(angle= 90))
    }
  })

  # generate a plot of members' estimated income levels
  output$plot_inc <- reactivePlot(function() { 
    # call to update age factor if needed
    updateAge_f()

    if (input$factor_age == TRUE) {
      ggplot(demos2, aes(inc)) + geom_bar() + 
        facet_wrap(~ age_f, ncol= 3) + theme_bw() +
        labs(title= "Estimated Income by Age Bracket",
             y= "Count of Individuals",
             x= "Estimated Income Range") +
        theme(axis.text.x= element_text(angle= 90))
    } else if (input$factor_age == FALSE) {
      ggplot(demos2, aes(inc)) + geom_bar() + 
        theme_bw() +
        labs(title= "Estimated Income of your Members",
             y= "Count of Individuals",
             x= "Estimated Income Range") +
        theme(axis.text.x= element_text(angle= 90))
    }
  })

  # generate a plot of members' homeownership
  output$plot_h_own <- reactivePlot(function() { 
    # call to update age factor if needed
    updateAge_f()

    if (input$factor_age == TRUE) {
      ggplot(demos2, aes(homeOwner)) + geom_bar() + 
        facet_wrap(~ age_f, ncol= 3) + theme_bw() +
        labs(title= "Home Ownership by Age Bracket",
             y= "Count of Individuals",
             x= "Home Owner / Renter") +
        theme(axis.text.x= element_text(angle= 90))
    } else if (input$factor_age == FALSE) {
      ggplot(demos2, aes(homeOwner)) + geom_bar() + 
        theme_bw() +
        labs(title= "Home Ownership of your Members",
             y= "Count of Individuals",
             x= "Home Owner / Renter") +
        theme(axis.text.x= element_text(angle= 90))
    }
  })
})

Any help would be appreciated, still trying to learn shiny (like everyone else).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:41:46+00:00Added an answer on June 16, 2026 at 1:41 am

    In ui.R, you should not have a comma at the end of this line:

    sliderInput("age_cut", "Select Size of Age Brackets:",
                min= 3, max= 20, value= 5),
    

    There also shouldn’t be a comma at the end of this line

    checkboxInput(inputId = "h_own",       label = "Homeownership",         value = FALSE),
    

    In general, you shouldn’t have a comma after the last component of a section. Just like with any R function, you don’t usually end the function call with a comma. e.g. sum(5,) gives an error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: Edited code example to use AutoA for the workaround (which was the original
UPDATE 1 ADDED UPDATED CODE I have a django template on app engine. Currently
UPDATE 9/12/2012: I shared my code with a co-worker and everything worked fine for
Update: part of the problem might have been solved by accessing the data like
UPDATE: I've been playing around with this more, and it seems like tmux's clear-history
Update : This is no longer an issue from C# 6, which has introduced
Update : I found almost exact similar question , yet it has slightly different
UPDATE: I'm getting this error: (No route matches /docs/index.html... ) when accessing admin.example.com/docs/index.html The
Update: Tried SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; and it's noticeable at full zoom, but it doesn't
Update following initial comments The model has an object in it called 'Account', of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.