The ui.R file to display dynamic info boxes is similar to the function we already saw to display static info boxes, except now the function is infoBoxOutput(). Putting all four info boxes together, we now get the following:
fluidRow(
infoBoxOutput(width = 3, "infoYears"),
infoBoxOutput(width = 3, "infoLifeExp"),
infoBoxOutput(width = 3, "infoGdpPercap"),
infoBox(width = 3, "Shiny version", "1.1.0",
icon = icon("desktop")))
As elsewhere, in each case infoBoxOutput() is given a string (infoYears), which refers to the name of the corresponding output element (output$infoYears).