我正在尝试运行Shiny的示例代码,app.R。如果我点击"运行App",我有以下错误:
Error in normalizePath(path.expand(path), winslash, mustWork) : path[1]="XXXXXXX": Access is denied
根据我的搜索,它是一个RStudio问题,但我的其他工作正常。
这是R代码:
require(shiny)
require(shinythemes)
require(DT)
require(DBI)
source("Shiny/global.R")
server <- function(input, output, session) {
# Expression that generates a histogram. The expression is
# wrapped in a call to renderPlot to indicate that:
#
# 1) It is "reactive" and therefore should re-execute automatically
# when inputs change
# 2) Its output type is a plot
output$distPlot <- renderPlot({
x <- faithful[, 2] # Old Faithful Geyser data
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')
})
}
#==== UI ====
ui <- shinyUI(
fluidPage(
# Application title
titlePanel("Hello Shiny!"),
# Sidebar with a slider input for the 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")
)
)
)
)
shinyApp(ui = ui, server = server, onStart = "global.R")
我没有真正更改示例代码,sessioninfo()看起来像这样:
locale:
[1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252
[4] LC_NUMERIC=C LC_TIME=German_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DBI_0.7 DT_0.2 shinythemes_1.1.1 shiny_1.0.5 XML_3.98-1.9
[6] stringr_1.2.0 plyr_1.8.4 data.table_1.10.4-2 RODBC_1.3-15
loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 digest_0.6.12 mime_0.5 R6_2.2.2 xtable_1.8-2 magrittr_1.5 stringi_1.1.5
[8] tools_3.3.2 htmlwidgets_0.9 rsconnect_0.8.5 httpuv_1.3.5 htmltools_0.3.6
>
有没有办法解决这个问题?