r - 无法运行我闪亮的应用程序 - readLines 中的错误(文件,警告 = FALSE):无法打开连接
问题描述
我正在尝试运行我自己的闪亮应用程序,但我总是在控制台中收到一条错误消息。这是警告消息:
Loading required package: shiny
Warning in base::file(file, encoding = enc) :
'raw = FALSE' but '/Users/octaviodelsueldo/Documents/CUNEF/Tecnicas de Visualizacion/Trabajo_2_Shiny/app.R' is not a regular file
Warning in readLines(file, warn = FALSE) :
cannot open file '/Users/octaviodelsueldo/Documents/CUNEF/Tecnicas de Visualizacion/Trabajo_2_Shiny/app.R': it is a directory
Error in readLines(file, warn = FALSE) : cannot open the connection
我不知道为什么会这样。如果其中任何一个不正确,我会在下面向您展示代码。
library(shiny)
library(ggplot2)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Ejercicio 2 de Shiny"),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot", hover = "hover"), #el input hover se va a disparar cuando un usuario pase el raton en la grafica distplot. Su contenido es una lista de cosas.
dataTableOutput("resultadoFiltro") #permite imprimir un dataframe de forma tabulada
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
# ReactiveVal es un reactivo que se puede modificar y hacer cosas como agregar o retirar lineas o columnas.
# ReactiveVal lo manipulamos nosotros directamente
dataset <- reactiveVal({
data.frame(x = rnorm(30), y = rnorm(30))
})
#Plot de la distribucion normal aleatoria creada
output$distPlot <- renderPlot({
ggplot(dataset(), aes(x = x, y = y)) + geom_point()
})
output$resultadoFiltro <- renderDataTable({
nearPoints(dataset(), input$hover) #busca los puntos cercanos a una posicion. Esta funcion devuelve un dataframe con las filas seleccionadas
})
}
# Run the application
shinyApp(ui = ui, server = server)
任何帮助您将不胜感激。
解决方案
推荐阅读
- python - 初始化 DVC 存储库会引发错误
- arrays - 将 laravel 中具有键值对的两个对象数组与特定键进行比较,并返回不匹配的键值
- android - 有什么方法可以使用 ktor WebSocket lib 检查 android 设备上的 connectionState 吗?
- c# - Unity 2020 和 Firebase 上的问题(无法解析参考“UnityEditor.iOS.Extensions.Xcode”)
- sql - phpMyadmin | 无法为数据库现有表中的特定新列 PUT 值
- vba - MS-Access:循环遍历表中每个不同值的代码
- hive - Impala 小数列中的位和运算
- mysql - 如何使用带有 Node.js 的 Webhook Tripadvisor API 在 Dialogflow 中跟进多个意图
- python - 优化功能
- swift - Swift:当 SpriteNode 接触任何 CGRect 时,我可以将变量更改为 CGRect 吗?