为什么在R中运行闪亮的应用程序之前必须加载程序包和文件?

时间:2019-09-12 15:06:47

标签: r shiny rstudio

我想知道为什么当我在r-studio中打开一个闪亮的应用程序时,必须先运行所有程序包和文件,然后才能运行该应用程序。我只想在运行应用程序botton中放个小调,然后自动加载所有内容。有一个干净的解决方案吗?

这是我的错误:

Listening on http://127.0.0.1:4659
Warning: Error in dropNulls: object 'df1' not found
  61: dropNulls
  60: getSliderType
  59: sliderInput

df1是一个Excel文件,代码位于server.R中的ShinyServer(function(input,output){})

df1=data.frame(read_excel("C:/Users/Desktop/Prueba/Base.xlsx", sheet = "1.1.1"))

library(readxl)

在“ shinyServer(....)”之前

1 个答案:

答案 0 :(得分:0)

它确定以与ui.R和server.R相同的方向创建一个global.R文件。 谢谢MrFlick提供信息。