3

I'm making a shiny app with golem, which automatically makes it a package and for some background calculations that happen before the user does anything I'm loading in an excel file (just with xlsx's read_xlsx function).

This works great on my local machine but when someone else tries to use my package it doesn't work, because they don't have my excel file on their machine.

How do I include my file in the shiny app, so the code can read it?

PanikLIji
  • 31
  • 4
  • 2
    If your file is not big, you can put it in `inst/app/www/` and then use it in your app with `read_xlsx("inst/app/www/yourfile.xlsx")`. If your file is big, you should find another solution – gdevaux Aug 16 '22 at 13:46
  • 3
    You can put it in `inst/extdata`. Then once you build the package you can get it with `system.file("extdata", "yourfile.xlsx", package = "yourpackage")`. – Stéphane Laurent Aug 16 '22 at 15:12

0 Answers0