Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/69.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 - Fatal编程技术网

R 嵌套闪亮应用程序不';我不能正常工作

R 嵌套闪亮应用程序不';我不能正常工作,r,shiny,R,Shiny,我正在尝试构建一个大的闪亮的应用程序,由几个小型应用程序组成 其想法是构建一个应用程序,其顶部有一个navbarPage(a),由tabPanel(s)和navbarMenu(s)组成,并且对于其中一些语音,可以在左侧有一个“横向菜单”(B)(sidebarPanel或类似)和其他语音 最后,对于这些语音中的每一种,都有可能只构建一个应用程序,其中左面板(C)位于“左菜单”(B)旁边,输出菜单(D)位于右侧 在这里,我报告了一个截图,给出了一个视觉效果: 如您所见,面板C和输出菜单D位于单独的

我正在尝试构建一个大的闪亮的应用程序,由几个小型应用程序组成

其想法是构建一个应用程序,其顶部有一个navbarPage(a),由tabPanel(s)和navbarMenu(s)组成,并且对于其中一些语音,可以在左侧有一个“横向菜单”(B)(sidebarPanel或类似)和其他语音

最后,对于这些语音中的每一种,都有可能只构建一个应用程序,其中左面板(C)位于“左菜单”(B)旁边,输出菜单(D)位于右侧

在这里,我报告了一个截图,给出了一个视觉效果:

如您所见,面板C和输出菜单D位于单独的“可滚动”框架中。当从“左面板”B中选择“1”语音时,调用shinyApp函数可以看到此问题

在这里,我报告了一个分为文件的简化代码:

##### Main app code:
MainUI <- fluidPage(
  navbarPage(title = "title",
                      ## other voices
                      navbarMenu("voice 5",
                                 tabPanel("menu 1",
                                          uiOutput("menu51")
                                 ),
                                 tabPanel("...")
                      )
  )
)

MainServer <- function(input, output, session) {
  output$menu51 <- renderUI({
    menu51UI
  })

}

##### menu51 code:
menu51UI <- fluidPage(
    navlistPanel(
      "menu 5>1",
      tabPanel("1",
               shinyApp(exampleUI, exampleServer)
               ),
      tabPanel("2"),
      tabPanel("3"),
      widths=c(2,10)
    )
)

BedUtilitiesServer <- function(input, output, session) {
##
}

##### example app code:
exampleUI <- fluidPage(
  titlePanel("Sort"),
  fluidRow(
    column(2, 
      wellPanel(
        checkboxInput(inputId = 'directory_flag', label = 'Directory path?', value = FALSE),
        fileInput(inputId = "infiles", label = "Choose file(s)", multiple = TRUE),
        checkboxInput(inputId = 'descending_flag', label = 'Descending', value = FALSE),
        checkboxInput(inputId = 'merge_flag', label = 'Merge', value = FALSE),
        actionButton(inputId = "sortbed_button", label="sort file(s)", width = "100%", icon = icon(name="sort")),
        tags$hr(),
        tags$p("Loaded file(s):"),
        verbatimTextOutput("file_loaded")
      )
    ),
    column(8,
           uiOutput("data_tables")
    )
  )
)

exampleServer <- function(input, output, session) {
 ## some computation functions
}
主要应用程序代码:

MainUI您指定许多我认为是闪亮的服务器功能的原因是什么?(
函数(输入、输出、会话){
)如果你想制作一个由许多小的闪亮应用程序组成的闪亮应用程序,你可以使用iframes来显示包含的闪亮应用程序。原因很简单,因为代码具有模块性……如果你想更改“miniapp”的代码,你只需更改“miniapp”代码,保持其他应用程序的代码不变!关于iFrame,我很想使用它们,但是当你可以使用闪亮的R代码时,为什么要使用它们呢?无论如何,你能给我举个例子吗?谢谢!^^我看到了,shinyApp的有趣用法。
shinyApp
。我没有以这种方式使用它的任何经验,所以我必须研究一下。谢谢你的兴趣,我会的看看iframes在shinyapps中的使用…^^^^这样做,缺点是它要求您运行shiny server,而不是从R内部运行shiny。使用GET方法可以轻松地将数据发送到应用程序实例。您为什么指定了许多我认为是shiny server函数的功能?(
函数(输入、输出、会话){
)如果你想制作一个由许多小的闪亮应用程序组成的闪亮应用程序,你可以使用iFrame来显示包含的闪亮应用程序。原因很简单,因为代码具有模块性……如果你想更改“miniapp”的代码,你只需更改“miniapp”代码,保持其他应用程序的代码不变!关于iFrame,我很想使用它们,但是当你可以使用闪亮的R代码时,为什么要使用它们呢?无论如何,你能给我举个例子吗?谢谢!^^我看到了,shinyApp的有趣用法。
shinyApp
。我没有以这种方式使用它的任何经验,所以我必须研究一下。谢谢你的兴趣,我会的看看iframes与shinyapps一起使用…^^^^这样做,缺点是它要求您运行shiny server,而不是从R内部运行shiny。使用GET方法可以轻松地将数据发送到应用程序实例。
##### Main app code:
MainUI <- fluidPage(
  navbarPage(title = "title",
                      ## other voices
                      navbarMenu("voice 5",
                                 tabPanel("menu 1",
                                          uiOutput("menu51")
                                 ),
                                 tabPanel("...")
                      )
  )
)

MainServer <- function(input, output, session) {
  output$menu51 <- renderUI({
    menu51UI
  })

}

##### menu51 code:
menu51UI <- fluidPage(
    navlistPanel(
      "menu 5>1",
      tabPanel("1",
               ########
               uiOutput("example_ui")
               ),
      tabPanel("2"),
      tabPanel("3"),
      widths=c(2,10)
    )
)

BedUtilitiesServer <- function(input, output, session) {
output$example_ui <- renderUI({
    #######
    exampleUI 
  })
}

##### example app code:
exampleUI <- fluidPage(
  titlePanel("Sort"),
  fluidRow(
    column(2, 
      wellPanel(
        checkboxInput(inputId = 'directory_flag', label = 'Directory path?', value = FALSE),
        fileInput(inputId = "infiles", label = "Choose file(s)", multiple = TRUE),
        checkboxInput(inputId = 'descending_flag', label = 'Descending', value = FALSE),
        checkboxInput(inputId = 'merge_flag', label = 'Merge', value = FALSE),
        actionButton(inputId = "sortbed_button", label="sort file(s)", width = "100%", icon = icon(name="sort")),
        tags$hr(),
        tags$p("Loaded file(s):"),
        verbatimTextOutput("file_loaded")
      )
    ),
    column(8,
           uiOutput("data_tables")
    )
  )
)

exampleServer <- function(input, output, session) {
 ## some computation functions
}