![]() ![]() Additionally, all of the functions and modules we create for our Shiny app will be stored in the R folder. Run_app.R launches our Shiny app and app_config.R is used to access files in the application. app_server.R and app_ui.R files function roughly the same as a basic Shiny app’s ui.R and server.R. The R folder comes with the following pre-existing files: app_config.R, app_server.R, app_ui.R and run_app.R. Run_dev.R documents/loads our package and runs the Shiny application locally. This file will be used throughout our development process.Ġ3_deploy.R is only used when we are ready to deploy our project to a server. ![]() This file allows us to set up our description file, create common files, such as a readme, add a folder for tests and much more.Ġ2_dev.R enable us to easily add package dependencies, generate modules and add helper functions. The dev folder contains scripts that will be used frequently:Ġ1_start.R is already open when you start the project and should be completed first. The folders that we will focus on are R and dev. Right after running this code we are greeted with several folders and files. We will be using this notation throughout the development process. Since many packages have conflicting function names, this notation ensures that we use the exact function we want. One important note to make about the code above is that we specifically called the golem package to run a function, golem::create_golem(). Once the package is installed, you can also create a golem project by going to ‘File’ → ‘New Directory’ → ‘Package for Shiny App using golem’ in RStudio. Note: the file location should be adjusted as needed. # general case: golem::create_golem(“PATH/SUBDIRECTORY") Golem::create_golem("~/Documents/theoffice") In RStudio, run this in your console: install.packages(“golem”) This post does not cover everything though, so check out for more information. This post walks you through starting a Shiny app with golem, while also highlighting the important files included. A Shiny app with the golem structure is well defined, organized, and durable. If you simply search “golem” on Google, you see words like “unformed”, “imperfect”, or “shapeless”, but I would not describe the golem package this way. If you are just starting this, please take a look at the first post to see an overview. Welcome to the second post of our blog series where we are working on creating a Shiny app with the package for the hit TV show, The Office. ![]()
0 Comments
Leave a Reply. |