问题描述:
我新建了一个shiny web app进入之后它有一个自带的代码如下,我运行之后只显示了按钮,图片不显示,然后我又使用了shiny自带的第一个代码也是出现这个问题
我的代码、运行结果如下
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
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 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.5.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 digest_0.6.25 withr_2.3.0 later_1.1.0.1 mime_0.9 plyr_1.8.6 R6_2.5.0
[8] xtable_1.8-4 jsonlite_1.7.1 magrittr_1.5 stringi_1.5.3 rlang_0.4.7 reshape2_1.4.4 promises_1.1.1
[15] Cairo_1.5-12.2 tools_4.0.2 stringr_1.4.0 httpuv_1.5.4 fastmap_1.0.1 compiler_4.0.2 htmltools_0.5.0