当你点击(文件>新文件>闪亮的网络应用程序)时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’
答案 0 :(得分:1)
此问题已在此处报告并解决。 https://github.com/rstudio/shiny/issues/1726
简而言之,当R更新为3.4
时,需要更新包 update.packages(ask = FALSE, checkBuilt = TRUE)