Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.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
Css R:交互式修改应用程序主题_Css_R_Shiny - Fatal编程技术网

Css R:交互式修改应用程序主题

Css R:交互式修改应用程序主题,css,r,shiny,Css,R,Shiny,我试图找到一种从文本输入交互修改应用程序主题的方法 下面是我的ui.R的一个例子 shinyUI(fluidPage( tabsetPanel( tabPanel("Main"), tabPanel("Settings", textInput("skin", "Select Skin", value = "bootstrap1.css") ), type = "pills", position = "above" ),theme = input$sk

我试图找到一种从文本输入交互修改应用程序主题的方法

下面是我的ui.R的一个例子

shinyUI(fluidPage(
  tabsetPanel(
    tabPanel("Main"),
    tabPanel("Settings",
      textInput("skin", "Select Skin", value = "bootstrap1.css")
    ), type = "pills", position = "above"
   ),theme = input$skin
  )
)
我收到以下错误:“错误:找不到对象‘输入’”


最后,我在app文件夹中创建了一个foler www,其中包含bootstrap1.css和其他css文件。

fluidPage中的
主题
选项插入一个css脚本,调用如下:

tags$head(tags$link(rel = "stylesheet", type = "text/css", 
                            href = input$Skin))
您可以将此html作为反应元素添加到ui中:

library(shiny)
runApp(list(ui = fluidPage(
  tabsetPanel(
    tabPanel("Main"),
    tabPanel("Settings",
             textInput("Skin", "Select Skin", value = "bootstrap1.css")
    ), type = "pills", position = "above"
  ), 
  uiOutput("myUI")
)
, server = function(input, output, session){
  output$myUI <- renderUI({
    tags$head(tags$link(rel = "stylesheet", type = "text/css", 
                        href = input$Skin))
  })
}
))
库(闪亮)
runApp(列表(ui=fluidPage(
选项卡面板(
选项卡面板(“主要”),
选项卡面板(“设置”,
textInput(“皮肤”,“选择皮肤”,value=“bootstrap1.css”)
),type=“pills”,position=“over”
), 
uiOutput(“myUI”)
)
,服务器=功能(输入、输出、会话){

输出$myUI我感谢您的详细回复。这正是我所寻找的。