Skip to content

Use box in shiny folder structure. #331

Answered by klmr
shahronak47 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Ronak,

That error isn’t actually related to ‘box’, it’s just a typo: you are calling the server$server function instead of passing it to shinyApp. Do the following instead:

shinyApp(ui$ui, server$server)

But there are some ‘box’ related code issues as well. In fact, some things might happen to work but aren’t guaranteed to work, and I strongly suggest changing them to make the code more robust.

First off, inside the server you are using the wrong path in readRDS(). You need to specify the path relative to the current module, because otherwise you are relying on the value of getwd(), which isn’t generally robust. Use box::file() to get a guaranteed robust path:

out <- readRDS(box::file(".…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shahronak47
Comment options

Answer selected by shahronak47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants