Warning: Error in : `path` does not exist in Shiny App

Viewed 281

I uploaded this rmarkdown into my account in shinyapp but I got this error when I run the app online:

"Warning: Error in : path does not exist"

It's working perfectly in my personal computer. I am using the relative path inside my code and I uploaded the spreadsheets together:

UI screenshot

I tried to upload outside a project in another folder, but it doesn't work at all.

portfolio_returns <- eventReactive(input$go, {
  
  precos<-read_excel("Cotas Backup.xlsm")[-1,]
  colnames(precos)[1]<-"Data"

...

  compra <- readxl::read_excel("Consulta Aplicações e Resgates de Fundos - Versão 2-0.xlsx") %>% 
  dplyr::mutate(Ativo = paste(NM_CARTEIRA, NM_FUNDO)) %>% 
  group_by(Ativo, DT_COMPRA) %>% 
  summarise(Qtd_Comprada = sum(QT_COMPRA))

  venda <- readxl::read_excel("Consulta Aplicações e Resgates de Fundos - Versão 2-0.xlsx", sheet =2) %>% 
    dplyr::mutate(Ativo = paste(NM_CARTEIRA, NM_FUNDO)) %>% 
    group_by(Ativo, DT_FINANCEIRO) %>% 
    summarise(Qtd_Vendida = sum(QT_RECEBIDA))
  
  plano <- compra %>% 
    group_by(Ativo) %>% 
    slice(1) %>% 
    select(Ativo) %>% 
    filter(!grepl("FIP", Ativo) & !grepl("FIDC", Ativo))

#####Usando o calendário de dias úteis#####
  create.calendar("Brazil/ANBIMA", holidaysANBIMA, weekdays=c("saturday", "sunday"))
  vetordias <- bizdays::bizseq("2010-11-24", Sys.Date(), "Brazil/ANBIMA") %>% 
    tibble::as_tibble() %>% 
    `colnames<-`(c("data")) %>% 
    slice(rep(1:n(), each = length(plano$Ativo)))

#######Gerando a quantidade de dias sufientes para cruzar com a base######

  vetordias$ativos<-apply(plano, 2,function(x){ rep(x, length(vetordias$data)/length(plano$Ativo))})
  vetordias$ativos<-vetordias$ativos[,1]


#####cruzamento das planilhas com o calendário e o preenchimento com zero e a geração da variável de estoque####
  


  base[is.na(base)] <- 0
  
  nome <- readxl::read_excel("Consulta Aplicações e Resgates de Fundos - Versão 2-0.xlsx") %>% 
    dplyr::mutate(Ativo = paste(NM_CARTEIRA, NM_FUNDO)) %>% 
    group_by(Ativo) %>% 
    slice(1) %>% 
    ungroup() %>% 
    select(Ativo, NM_CARTEIRA, NM_FUNDO)
 ... 
 
  
  })
  


# Retornos

## Column {.tabset}

### Histograma dos Retornos

{r, echo=FALSE}

renderPlot({
  
    validate(need(input$go, "Clique em Submeter."))
  
  portfolio_returns() %>% 
  ggplot(aes(x = port_ret*100)) + 
  geom_histogram(bins = 60) +
  theme_light() +
  labs(x = "Retorno Portfolio",
       y = "Frequência",
       title = "Histograma PSI - Retornos Diários")


})  

0 Answers
Related