At http://shiny.rstudio.com/articles/scoping.html the rules for scoping in shiny are well explained. There are 3 environments or levels nested inside each other: objects available within a function, within a session and within all sessions. Using <- will change the object within the environment you are in and <<- will change it globally i.e. for all sessions.
What if I define a variable within the session but want to change it from within a function?
<- will just change it within the function so not readable by other functions and <<- will change it for all sessions. Is there nothing inbetween? Like "just one level up"?
Thanks for that reference Stephane. If an object is defined before the shinyServer() then using <<- anywhere within shinyServer() will change the value for all instances of the app. If the object is defined within shinyServer() then <<- (inside or outside a function) will only change the value for that instance of the app.
I put together a little app with a counter and instance ids to test this. Running two instances of the app and switching between them increasing the count demonstrates the effect of <<-
ui.r
server.r