I have a shiny code that runs on an RStudio Connect server. Due to the size of datasets that it is means to upload these dataset files are saved on the cloud and only upon selection of the user that's using the deployed shiny app on the RStudio Connect server, the selected dataset's files are copied from the cloud to the RStudio Connect server directory, read by the shiny code, and subsequently deleted.
I would like to allow this shiny code to also be run locally (meaning not on the RStudio Connect server). So ideally I'd have a condition in the code to test if it is on the RStudio Connect server or locally. In case of the former, proceed with the procedure I described above and in case of the latter, read the selected dataset's files locally (they are assumed to exist there).
Is there such an R function/command that tests if the code is executed on the RStudio Connect server or locally? Or this cannot be done and I need to resort to having two R shiny codes, one for the RStudio Connect server and the other for the local usage?