简体   繁体   English

RStudio Shiny应用程序崩溃

[英]RStudio Shiny app crashes

Shiny app, which is automatically generated by rstudio when you click (file > new file > shiny web app) doesn't work, turns to gray screen on chrome and RStudio crashes. 单击(文件>新文件>闪亮的Web应用程序)时rstudio自动生成的闪亮应用程序不起作用,在chrome上显示为灰屏,并且RStudio崩溃。

I noticed this when my own app crashed when I tried to add output of a ggplot chart. 当我尝试添加ggplot图表的输出时,当我自己的应用程序崩溃时,我注意到了这一点。 This template has a basic histogram, I guess the problem is about plots. 该模板具有基本的直方图,我想问题出在情节上。

I only copy and paste template here 我只在这里复制和粘贴模板

library(shiny)

# Define UI for application that draws a histogram
ui <- fluidPage(

# Application title
titlePanel("Old Faithful Geyser Data"),

# Sidebar with a slider input for number of bins 
sidebarLayout(
   sidebarPanel(
      sliderInput("bins",
                  "Number of bins:",
                  min = 1,
                  max = 50,
                  value = 30)
   ),

   # Show a plot of the generated distribution
   mainPanel(
      plotOutput("distPlot")
   ) ) )
# Define server logic required to draw a histogram
server <- function(input, output) {

 output$distPlot <- renderPlot({
    # generate bins based on input$bins from ui.R
    x    <- faithful[, 2] 
    bins <- seq(min(x), max(x), length.out = input$bins + 1)

    # draw the histogram with the specified number of bins
    hist(x, breaks = bins, col = 'darkgray', border = 'white')
 }) } 
# Run the application 
shinyApp(ui = ui, server = server)

my session info 我的会话信息

sessionInfo() 
R version 3.4.0 (2017-04-21) 
Platform: x86_64-w64-mingw32/x64 (64-bit) 
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale: 
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United States.1252    

attached base packages: 
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):  
[1] colorspace_1.3-1   scales_0.4.1      compiler_3.4.0   lazyeval_0.2.0   plyr_1.8.4    
[6] tools_3.4.0        gtable_0.2.0      tibble_1.3.3     Rcpp_0.12.11     ggplot2_2.2.1.9000
[11] grid_3.4.0         rlang_0.1.1       munsell_0.4.3  

packageVersion("shiny") # ‘1.0.3’

This issue reported and solved here. 此问题已在此处报告并解决。 https://github.com/rstudio/shiny/issues/1726 https://github.com/rstudio/shiny/issues/1726

in short, packages needs to be updated when R updated to 3.4 简而言之,当R更新为3.4时,需要更新软件包

 update.packages(ask = FALSE, checkBuilt = TRUE)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM