Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 以闪亮的单选按钮在同一行上显示标签和选项_R_Shiny_Radio Button_Label_Choice - Fatal编程技术网

R 以闪亮的单选按钮在同一行上显示标签和选项

R 以闪亮的单选按钮在同一行上显示标签和选项,r,shiny,radio-button,label,choice,R,Shiny,Radio Button,Label,Choice,我希望标签和选项都显示在同一行的单选按钮中 我试过: tags$div(tags$span(radioButtons("id",label = "Label:",choices = c("All "="all","Option One"="option1","Option Two"="option2"),inline=TRUE))) 带或不带“标签$div(标签$span(“件”) 我希望结果是: Label: ()All ()Option One () Option two 相反,我仍在努

我希望标签和选项都显示在同一行的单选按钮中

我试过:

tags$div(tags$span(radioButtons("id",label = "Label:",choices = c("All "="all","Option One"="option1","Option Two"="option2"),inline=TRUE)))
带或不带“标签$div(标签$span(“件”)

我希望结果是:

Label: ()All ()Option One () Option two
相反,我仍在努力

 Label:
 ()All ()Option One () Option two

有什么建议吗?

带有串联信息的新变量会起作用吗

比如:

 df$labelNew<-paste(df$var,"",df$choices)
library(shiny)

ui <- fluidPage(
  tags$head(
    tags$style(
      HTML(
        "
        label{
          float:left;
        }
      "
      ))),

      radioButtons("id1",label = "Label:",choices = c("All "="all","Option One"="option1","Option Two"="option2"),inline=TRUE)

)

server <- function(input, output) {

}

shinyApp(ui, server)

df$labelNewTry
float:left

因此,它将类似于:

 df$labelNew<-paste(df$var,"",df$choices)
library(shiny)

ui <- fluidPage(
  tags$head(
    tags$style(
      HTML(
        "
        label{
          float:left;
        }
      "
      ))),

      radioButtons("id1",label = "Label:",choices = c("All "="all","Option One"="option1","Option Two"="option2"),inline=TRUE)

)

server <- function(input, output) {

}

shinyApp(ui, server)
库(闪亮)

ui您可能误解了这个问题。OP询问的是标签显示在选项左侧的ui,而不是标签位于选项顶部的标准ui。@Shree您是对的。我正在尝试是否有方法更改单选按钮的默认行为,以便将标签显示在选项左侧。我建议添加图像为了提高帖子的清晰度。应该容易上漆。