O'Reilly logo

Learning Shiny by Hernán G. Resnizky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The isolate() function

isolate() is a function that does exactly what is expected; it isolates a piece of code. In a Shiny reactive context, this means that it prevents the execution of a piece of code unless, of course, certain condition is met. The condition that isolate() takes in order to re-execute the piece of code is, however, not evaluated in the usual way (that is, in the way that returns TRUE or FALSE), it evaluates whether the object changes or not.

The object to evaluate the condition that is mostly used within isolate() is the action button. The actionButton() function, apart from drawing a button in the interface, creates an object, which is mainly a counter that whenever the button is hit, it increases its value by 1. It becomes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required