I think of the global.R file as a file that is being run once before app starts. That means we can use it for all sorts of data processing, running models, and, of course, to load in your data. In global.R I am creating vector of random values. Locally when I refresh my web page it returns the same random values which makes sense as global.R runs once. I want to understand how it would work in docker containers using shinyproxy. Docker creates separate container for each user. Would it mean different random values of global.R shown for each users every-time (till container is closed)? And refreshing the web page (hosted in docker) means separate container? Note : I don't want to set seed. I need randomization only
Asked
Active
Viewed 89 times
0
-
I assume this does not answer your question, but for the chance that it does: If you set set.seed(x) the random values will be the same, as are all other outputs that rely on randomness. You could give the seed via environmental variables while building docker or even on starting the container to have different values in each container – David Apr 30 '21 at 17:09
1 Answers
0
I think you'd need to explicitly set you seed otherwise (from the docs):
Initially, there is no seed; a new one is created from the current time and the process ID when one is required.

SmokeyShakers
- 3,372
- 1
- 7
- 18