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?

2
  • 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 Commented Aug 16, 2022 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"). Commented Aug 16, 2022 at 15:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.