If we want to use our app out of R Studio we will need to deploy it to a Shiny Server. There are a number of options for doing this:
Setting up a Shiny Server is beyond the scope of this workshop (though there are some brief notes on the options for doing this in going further. In this workshop we’ll deploy our app to shinyapps.io.
Create an account on shinyapps.io via https://www.shinyapps.io/admin/#/signup You can do this using a Google or Github account, or using a username/password.
Having created an account, we can deploy the app directly from R Studio. To do this, click the blue publish icon (to the right of the run button). You will be prompted to enter your account token. This can be obtained from the dashboard for your shinyapps.io account. Click the account menu (on the left) then select tokens. Click “show”, “show secret” and then copy the token to the clipboard. This can be pasted into the box in Studio.
Having connected your account, check that the app.R
file and all its dependencies (plottingFunctions.R
and gapminder.rds
) are selected and then choose publish. The app will be packaged and uploaded to shinyapps.io. The deployment process automatically handles packaging the libraries we’ve used in our app.