簡體   English   中英

RStudio Shiny應用程序崩潰

[英]RStudio Shiny app crashes

單擊(文件>新文件>閃亮的Web應用程序)時rstudio自動生成的閃亮應用程序不起作用,在chrome上顯示為灰屏,並且RStudio崩潰。

當我嘗試添加ggplot圖表的輸出時,當我自己的應用程序崩潰時,我注意到了這一點。 該模板具有基本的直方圖,我想問題出在情節上。

我只在這里復制和粘貼模板

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)

我的會話信息

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’

此問題已在此處報告並解決。 https://github.com/rstudio/shiny/issues/1726

簡而言之,當R更新為3.4時,需要更新軟件包

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM