Hi All
I have a 2000 line script. I run it for a single entity which is specified at the start of the script. I have been asked if we could run the script for a second entity. I would like to have an R script that calls the previously mentioned script but changes the entity before sourcing it. I understand i could just put the whole script inside a function but this seems a bit overkill and also incredibly messy.
For example below is the script
entity <- "entity 1"
# Run 2000 line script and produce results
What i would like to do is something like
source_script("entity_1")
source_script("entity_2")
Does anyone have any suggestions on how one would approach this?
Thank you very much for your time