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
Can we remove elements from a shinyoutput object?
Some simple testing suggests no (at least not with the first few obvious guesses):
## in shinyServer(function(input, output, session)):output$foo<- renderText("foo")
## rm(output[["foo"]]) ## doesn't work## output[["foo"]] <- NULL ## also doesn't work
The reason for wanting such a function is to prevent server-side memory accumulation in long-running applications that frequently call insertUI() & removeUI().
For example, insertUI() might insert a dynamically-generated textOutput("foo", ...) element coupled to a corresponding output[["foo"]] <- renderText(...) assignment to the session's output object. Later, when removeUI() removes the textOutput("foo", ...) element, I'd like to 'clean-up' the session's output object by removing the output[["foo"]] entry. (In this example, "foo" is a randomly-generated unique ID.)
For applications where this is a frequent procedure the UI-side of the application can be kept tidy, but I suspect the server-side output object simply continues to accumulate these entries.
Is there any way to remove a specific entry in the output object by that entry's ID?
(I can't find any such function/procedure in the docs.)
The text was updated successfully, but these errors were encountered:
Can we remove elements from a shinyoutput object?
Some simple testing suggests no (at least not with the first few obvious guesses):
The reason for wanting such a function is to prevent server-side memory accumulation in long-running applications that frequently call
insertUI()
&removeUI()
.For example,
insertUI()
might insert a dynamically-generatedtextOutput("foo", ...)
element coupled to a correspondingoutput[["foo"]] <- renderText(...)
assignment to the session'soutput
object. Later, whenremoveUI()
removes thetextOutput("foo", ...)
element, I'd like to 'clean-up' the session'soutput
object by removing theoutput[["foo"]]
entry. (In this example, "foo" is a randomly-generated unique ID.)For applications where this is a frequent procedure the UI-side of the application can be kept tidy, but I suspect the server-side
output
object simply continues to accumulate these entries.Is there any way to remove a specific entry in the
output
object by that entry's ID?(I can't find any such function/procedure in the docs.)
The text was updated successfully, but these errors were encountered: