How to upload your Shiny App

Uploading your Shiny App

To upload your own Shiny App to a workspace, first, create a new Shiny App using the App dropdown menu. Then, you will be asked to name the Shiny App and choose a blank template. The template you choose will depend on whether you are using multiple files (server.R + ui.R) or a single file (app.R) in your application.

create_from_tmeplate.png

Once you created a blank template, navigate to the Shiny App folder in the Files tab, and paste your code into the appropriate files. Note that any libraries that the Shiny App uses will need to be installed in the workspace R Console.

server_paste2.gif

If your Shiny App contains files not included in the template, these can be uploaded directly into your application's folder. Once you are finished editing the source code, you can open your App in the Shiny App tab (you may need to refresh it for the changes to take effect).

my_first_app.png

For information on how to import data, how to change the tile image or R version that Shiny App is running, see customising your Shiny App article.

Deploying Aridhia's Shiny Apps to a workspace

Aridhia's Shiny Apps can be found on aridhia.shinyapps.io/menu/. From the homepage, you have the option of running the Shiny App on the web or visiting their GitHub repositories from where you can download the App source code for running it locally or in a workspace.

shiny_app_card.png

1. Download the App source code

To deploy Aridhia's Shiny App to a workspace, first, you need to navigate to its GitHub repository and download the Shiny App repository as a ZIP file.

github_repo.png

2. Create a new Shiny App from a template

Move to the workspace, go to ‘Apps’ > ‘+ New Shiny app’, and create a new blank Shiny App using the drop-down menu. Choose a name for the new Shiny App.

create-mini-app.png

This will create a new folder in the Files tab with the same name as the new Shiny App. Look for this folder (which we from now on will refer to as “the Shiny App folder”) and delete the app.R file in it. Make sure you keep the .version file!

3. Upload the code to a workspace

Then, upload the ZIP file you downloaded to the Shiny App folder.Unzip the file using the option on the right-hand menu.

When unzipping in the workspace, you will be asked to give a name to the folder the files will be extracted into. Leave this blank.

extract-files-to-folder.png

Navigate into the unzipped folder, select all files in it, and move them to the Shiny App folder (so, one level up). Delete the now empty unzipped folder.

4. Install App dependencies

Go to 'Tools' > 'New R console' and start the R console. In the right-hand side-panel, navigate to the dependencies.R script, and click on the arrow next to it. This will install all the packages needed for the Shiny App.

install-app-dependencies.png

5. Run the Shiny App

Go to ‘Apps’ > ‘View Shiny apps’ and start the new Shiny App.

You will see that the App code appears as a default when you start the Shiny App. If you want to hide the code, go to the Shiny App folder and delete the file called DESCRIPTION.

Updated on December 19, 2024

Was this article helpful?