You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author: AlysY
Repo: https://github.com/menzies-hotspots/AMR-HOTspots
Aim: I have 2 main queries. How could I set up the structure of having multiple scripts to be clearer to other people? I haven't collaborated on scripts before so improving the readibility and logic is important to me. Secondly, if anyone has experience with shiny then how I could simplify the code, for example using modules?
File Info: This repo creates a shiny app here https://anti-microbe-res.shinyapps.io/hotspots/ displaying information regarding antimicrobial resistance in Australia. The shiny code and app are in the app.R file. This file sources 5 other files: 1_functions.R , 2_load_data.R , 3_edit_this.R , 4_aesthetics.R , and 5_shiny_code.R . I usually lump all my code into one file, so this is my first time trying to split it logically.
The text was updated successfully, but these errors were encountered:
Hey @AlysY, I'll speak to your first query, and leave the shiny question to shiny experts.
I would suggest trying to use the targets package to streamline your pipeline. The core idea is that you modularise your code into functions, and then call these functions within a Yaml file which runs the whole analysis pipeline. The logic can easily be communicated to others in the targets.yml file that specifies and drives the whole pipeline, and there are functions to visualise the workflow for when it starts to get complicated. Here's an example from one of my projects that I'm working on:
You can also run the whole pipeline with a single command: tar_make(). It caches the outputs from previous runs and checks to see if your scripts have changed, and therefore only executes the parts that have changed and any dependencies when you go to re-run things. If you work with a lot of big objects, then this caching functionality could be really helpful so you don't have to sit around for hours or days waiting for parts to re-run.
Author: AlysY
Repo: https://github.com/menzies-hotspots/AMR-HOTspots
Aim: I have 2 main queries. How could I set up the structure of having multiple scripts to be clearer to other people? I haven't collaborated on scripts before so improving the readibility and logic is important to me. Secondly, if anyone has experience with shiny then how I could simplify the code, for example using modules?
File Info: This repo creates a shiny app here https://anti-microbe-res.shinyapps.io/hotspots/ displaying information regarding antimicrobial resistance in Australia. The shiny code and app are in the app.R file. This file sources 5 other files: 1_functions.R , 2_load_data.R , 3_edit_this.R , 4_aesthetics.R , and 5_shiny_code.R . I usually lump all my code into one file, so this is my first time trying to split it logically.
The text was updated successfully, but these errors were encountered: