Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/78.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,当我在默认的R studio R Shinny应用程序查看器中运行这个R Shinny应用程序时,没有显示复选框,我也不知道为什么。 有光泽的图书馆 library(shiny) # Define UI for application ui <- fluidPage( # Application title titlePanel("Fake App"), # Input sidebarLayout( sidebarPanel( ch

当我在默认的R studio R Shinny应用程序查看器中运行这个R Shinny应用程序时,没有显示复选框,我也不知道为什么。 有光泽的图书馆

library(shiny)

# Define UI for application
ui <- fluidPage(

   # Application title
   titlePanel("Fake App"),

   # Input
   sidebarLayout(
      sidebarPanel(
        checkboxGroupInput('disp', 'Display:', c(1, 2, 3, 4), 
                           selected = c(1))
      ),
      mainPanel(
         plotOutput("distPlot")
      )
   )
)

# Draw plot
server <- function(input, output) {

   output$distPlot <- renderPlot({
     ggplot()+ geom_point(aes(x=input$disp, y=input$disp)) 
   })
}

shinyApp(ui = ui, server = server)
这是我运行应用程序时的外观:

它可能是我运行这个的端口吗?我连接的网络?不,是吗?这是本地运行的吗?非常感谢您对这方面的见解

其他版本信息:

> R.version
           _                           
platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          4.3                         
year           2017                        
month          11                          
day            30                          
svn rev        73796                       
language       R                           
version.string R version 3.4.3 (2017-11-30)
nickname       Kite-Eating Tree     
> packageVersion("shiny")
[1] ‘1.1.0’

一些额外的调查显示,在浏览器中查看应用程序时会显示复选框,因此认为问题一定出在RStudio中。重新启动计算机修复了我的问题,因此复选框现在显示在RStudio应用程序查看器中

…您是否尝试过再次打开和关闭它?XD


谢谢你的帮助,所有评论的人

您好,您的应用程序运行正常。除了ggplot2之外,它没有被加载,您应该知道,没有bug或错误。事实上,我执行它没有问题。也许你需要重新安装shiny?我可以确认,没有错误,并且复选框显示正确。我刚刚确认,事实上只是在浏览器中打开它。
> R.version
           _                           
platform       x86_64-apple-darwin15.6.0   
arch           x86_64                      
os             darwin15.6.0                
system         x86_64, darwin15.6.0        
status                                     
major          3                           
minor          4.3                         
year           2017                        
month          11                          
day            30                          
svn rev        73796                       
language       R                           
version.string R version 3.4.3 (2017-11-30)
nickname       Kite-Eating Tree     
> packageVersion("shiny")
[1] ‘1.1.0’