如何将h4()和selectInput内联

时间:2019-01-29 02:13:11

标签: r

我是新手,我想知道如何在selectInput框旁边放置“ =”关闭?

library(shiny)
ui = fluidPage(
  mainPanel(
    titlePanel("Calculation:"),#Voltage calculation
    fluidRow(
      column(3,
             selectInput("selc11", h4("Cable"),#Resistivity
                         choices = list("Copper" = 0.0174, "Alum" = 0.0282), selected = 1)),
      h4("=")
    )
  )
)
server = function(input, output) {

}
shinyApp(ui = ui, server = server)

1 个答案:

答案 0 :(得分:0)

如果您想要这样的东西:

enter image description here

您可以通过以下方式实现它:

library(shiny)
library(shinyjs)

ui = fluidPage(
  useShinyjs(),
  mainPanel(
    titlePanel("Calculation:"),#Voltage calculation
    fluidRow(
      column(1, h4('Cable')),
      column(3, selectInput(
        "selc11",
        label = '',
        choices = list("Copper" = 0.0174, "Alum" = 0.0282), selected = 1)
      ),
      column(3, h4("="))
    )
  )
)
server = function(input, output) {
  runjs("$('label.control-label').remove()")
}
shinyApp(ui = ui, server = server)