R不读取文件路径

R不读取文件路径,r,shiny,readxl,R,Shiny,Readxl,考虑一个具有以下文件夹结构(github)的闪亮应用程序: 当未在应用程序中运行时,import\u finance.R将正确运行。但是,当运行闪亮的应用程序时,它无法识别路径 # list of quarterly earnings worksheets file_paths <- list.files('dashboard/data', pattern = 'xlsx', full.names = TRUE) path <- file_paths[1] # import al

考虑一个具有以下文件夹结构(github)的闪亮应用程序:

当未在应用程序中运行时,
import\u finance.R
将正确运行。但是,当运行闪亮的应用程序时,它无法识别路径

# list of quarterly earnings worksheets
file_paths <- list.files('dashboard/data', pattern = 'xlsx', full.names = TRUE)
path <- file_paths[1]


# import all sheets from each workbook and merge to one df

 import <-
  path %>%
  excel_sheets() %>%
  set_names() %>%
  map_df(xlsx_cells, path = path) %>%
  mutate(workbook = word(path, -1, sep = '/')) # add column with file_name
你知道我犯了什么错误吗?奇怪的是,脚本运行良好,但作为一个闪亮的应用程序运行时就不行了。

这里的错误在

# list of quarterly earnings worksheets
file_paths <- list.files('dashboard/data', pattern = 'xlsx', full.names = TRUE)

很遗憾,请尝试
source(“./data/import\u finance.R”)
同样的错误
> system.file("/Users/pblack/Documents/Git Projects/opensource-freetoplay-economics/dashboard/data/dashboard/data/ATVI 12-Quarter Financial Model Q1 CY20a.xlsx")  
[1] ""
# list of quarterly earnings worksheets
file_paths <- list.files('dashboard/data', pattern = 'xlsx', full.names = TRUE)
# list of quarterly earnings worksheets
file_paths <- list.files('data', pattern = 'xlsx', full.names = TRUE)