Software by Barret Schloerke#
Events attended by Barret Schloerke#
Posts and resources by Barret Schloerke#
Observability at scale (Barret Schloerke, Posit) | posit::conf(2025)
Observability at scale: Monitoring Shiny Applications with OpenTelemetry
Speaker(s): Barret Schloerke
Abstract:
Understanding what happens behind the scenes in production Shiny applications has always been challenging. When users experience slow response times or unexpected behavior, developers are left guessing where bottlenecks occur. This talk introduces OpenTelemetry integration for Shiny for R, a new approach to profiling code and understanding application behavior.
Through a chat-enabled weather application, we’ll explore how complex user interactions trigger cascading events across multiple processes. You’ll learn how OpenTelemetry’s “high-quality, ubiquitous, and portable telemetry” can provide complete visibility into your Shiny application’s performance with minimal setup… just a few environment variables!
After walking through the chat app, you’ll have a taste of how to implement comprehensive monitoring for your Shiny applications in production, enabling you to proactively identify and resolve unexpected performance issues.
Materials - https://github.com/schloerke/presentation-2025-09-17-posit-conf-otel posit::conf(2025) Subscribe to posit::conf updates: https://posit.co/about/subscription-management/

{shinylive}: Serverless Shiny applications workshop
{shinylive}: Serverless Shiny applications workshop: An exercise in deploying your app to GitHub Pages - Barret Schloerke
Resources mentioned in the workshop:
- Workshop slides (best viewed in browsers using Chrome engine): http://schloerke.com/workshop-rinpharma24-shinylive/
- Workshop GitHub repository: https://github.com/schloerke/workshop-rinpharma24-shinylive
Workshop recorded as part of the 2024 R/Pharma Workshop Series

Barret Schloerke - Editable data frames in Py-Shiny: Updating original data in real-time
Integrating editable data frames into Py-Shiny and Shinylive applications streamlines data scientists’ workflows by allowing real-time data manipulation directly within interactive web applications. This new feature enables users to edit cells within the data frame output. Using the empowered data frame renderer, we can facilitate immediate analysis and visualization feedback. It simplifies the process of data exploration and hypothesis testing, as changes to the data set can be instantly reflected in the application’s outputs without the requirement to update the original data, keeping data scientists “scientists”, not data janitors.
Talk by Barret Schloerke
Slides: http://schloerke.com/presentation-2024-08-13-posit-shiny-data-frame/
Slides GitHub Repo: https://github.com/schloerke/presentation-2024-08-13-posit-shiny-data-frame
Shiny: https://shiny.posit.co/
Shiny for Python: https://shiny.posit.co/py/
Component gallery: https://shiny.posit.co/py/components/
Edit Data Grid table cells: https://shiny.posit.co/py/components/outputs/data-grid/

{shinylive}: Serverless Shiny Apps | Barret Schloerke | Posit
In the rapidly evolving landscape of web technologies, the integration of R (and Python) with modern web frameworks has become increasingly important for data scientists and developers. This presentation introduces {shinylive}, a new R package that exports Shiny applications to be run within statically hosted websites. We will explore the capabilities of {shinylive} through its use of the innovative R package {webR}, which allows for the execution of R code in the browser (via WebAssembly and service workers) without the need for a centralized server.
The presentation will cover the technical foundation of {shinylive}, including its architecture and the integration process with Quarto documents. We will also discuss the practical aspects and drawbacks of exporting Shiny apps with {shinylive}, highlighting the ease of exporting apps to a folder for local use or hosting them on GitHub pages.
{shinylive} bridges the gap between Shiny and static websites, making it a valuable resource for interactive data analysis and presentation.
Link to app: https://schloerke.com/presentation-2024-04-18-appsilon-shinylive/ Link to script: https://github.com/posit-dev/r-shinylive/blob/main/examples/deploy-app.yaml Link to use_github_action(): https://github.com/posit-dev/r-shinylive#github-pages Shinylive website: https://posit-dev.github.io/r-shinylive/ {webr} docs: https://docs.r-wasm.org/webr/latest/

Barret Schloerke | {shinytest2}: Unit testing for Shiny applications | RStudio (2022)
Manually testing Shiny applications is often laborious, inconsistent, and doesn’t scale well. Whether you are developing new features, fixing bug(s), or simply upgrading dependencies, it is critical to know when regressions are introduced. The new {shinytest2} R package provides a toolkit for unit testing Shiny apps and seamlessly integrates with {testthat}. Under the hood, it uses the new {chromote} R package to render apps in a headless Chrome browser with features such as live preview and built in debugging tools. In this talk, you’ll learn how to test Shiny apps by simply recording your actions as code and extending it to test more particular aspects of your app, resulting in fewer bugs and more confidence in future development.
Talk materials are available at https://bit.ly/shinytest2-conf22
Session: I like big apps: Shiny apps that scale

Getting Started with {shinytest2} Part I || Example + basics || RStudio
00:00 Introduction 00:48 Overview of the demo Shiny app 03:00 Running record_test() 04:44 Results from record_test() 07:18 A note on .png files created during testing 08:52 Debugging with shinytest2 09:32 Using app$view() to open a visual representation of a headless browser
Part 2 - Exporting values: https://youtu.be/7KLv6HdIxvU Part 3 - Using shiny.testmode: https://youtu.be/xDxa_mDwN04
Manually testing Shiny applications is often laborious, inconsistent, and doesn’t scale well. Whether you are developing new features, fixing bug(s), or simply upgrading dependencies on a serious app where mistakes have real consequences, it is critical to know when regressions are introduced. shinytest2 provides a streamlined toolkit for unit testing Shiny applications and seamlessly integrates with the popular testthat framework for unit testing R code.
shinytest2 uses chromote to render applications in a headless Chrome browser. chromote allows for a live preview, better debugging tools, and/or simply using modern JavaScript/CSS.
By simply recording your actions as code and extending them to test the more particular aspects of your application, it will result in fewer bugs and more confidence in future Shiny application development.
Read up on shinytest2 here: https://rstudio.github.io/shinytest2/
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) Motion design and editing: Jesse Mostipak (@kierisi)
Theme song: Brad PKL by Blue Dot Sessions (https://app.sessions.blue/browse/track/113507 )

Getting Started with {shinytest2} Part 3 || Using shiny.testmode in {shinytest2} || RStudio
00:00 Introduction 00:15 Testing production apps
Part 1 - Getting started: https://youtu.be/SS1Na3c8lhk Part 2 - Exporting values: https://youtu.be/7KLv6HdIxvU
Manually testing Shiny applications is often laborious, inconsistent, and doesn’t scale well. Whether you are developing new features, fixing bug(s), or simply upgrading dependencies on a serious app where mistakes have real consequences, it is critical to know when regressions are introduced. shinytest2 provides a streamlined toolkit for unit testing Shiny applications and seamlessly integrates with the popular testthat framework for unit testing R code.
shinytest2 uses chromote to render applications in a headless Chrome browser. chromote allows for a live preview, better debugging tools, and/or simply using modern JavaScript/CSS.
By simply recording your actions as code and extending them to test the more particular aspects of your application, it will result in fewer bugs and more confidence in future Shiny application development.
Read up on shinytest2 here: https://rstudio.github.io/shinytest2/
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) Motion design and editing: Jesse Mostipak (@kierisi)
Theme song: Brad PKL by Blue Dot Sessions (https://app.sessions.blue/browse/track/113507 )

Getting Started with {shinytest2} Part 2 || Exporting values || RStudio
00:00 Introduction 00:29 Exporting reactives 03:28 Using exportTestValues()
Part 1 - Getting started: https://youtu.be/SS1Na3c8lhk Part 3 - Using shiny.testmode: https://youtu.be/xDxa_mDwN04
Manually testing Shiny applications is often laborious, inconsistent, and doesn’t scale well. Whether you are developing new features, fixing bug(s), or simply upgrading dependencies on a serious app where mistakes have real consequences, it is critical to know when regressions are introduced. shinytest2 provides a streamlined toolkit for unit testing Shiny applications and seamlessly integrates with the popular testthat framework for unit testing R code.
shinytest2 uses chromote to render applications in a headless Chrome browser. chromote allows for a live preview, better debugging tools, and/or simply using modern JavaScript/CSS.
By simply recording your actions as code and extending them to test the more particular aspects of your application, it will result in fewer bugs and more confidence in future Shiny application development.
Read up on shinytest2 here: https://rstudio.github.io/shinytest2/
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) Motion design and editing: Jesse Mostipak (@kierisi)
Theme song: Brad PKL by Blue Dot Sessions (https://app.sessions.blue/browse/track/113507 )

Programming Games with Shiny || Roll the Dice: with Quosures! || RStudio
00:00 Introduction
03:44 The pain of copy + paste
07:28 Going on a helper function adventure!
18:09 Ready for rlang
28:17 !! + enquo()
37:57 Benefits of the rlang approach
38:46 Embracing the embrace operator
41:33 Visualizing what’s happening using reactlog
You’ve most likely used Shiny to build a web app that displays data, but you can also use Shiny to build games! In this video series, Jesse and Barret pair program simply games in Shiny as a way to uncover and explore new features.
Read up on the embrace operator here: https://rlang.r-lib.org/reference/embrace-operator.html
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) and Jesse Mostipak (@kierisi) Animation, motion design, and editing: Jesse Mostipak (@kierisi)
Theme song: Hakodate Line by Blue Dot Sessions (https://app.sessions.blue/browse/track/111291" )

Programming Games with Shiny || Roll the Dice || RStudio
00:00 Introduction 01:40 Rolling with eventReactive( ) 06:26 Reducing eventReactive( ) to reactive( ) + isolate( ) 16:23 Combining reactive( ) and bindEvent( ) 20:11 Reviewing our reactives 21:23 Writing a function to de-duplicate dice rolls
You’ve most likely used Shiny to build a web app that displays data, but you can also use Shiny to build games! In this video series, Jesse and Barret pair program simply games in Shiny as a way to uncover and explore new features.
Read up on tabset panels here: https://shiny.rstudio.com/reference/shiny/0.14/tabsetPanel.html
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) and Jesse Mostipak (@kierisi) Animation, motion design, and editing: Jesse Mostipak (@kierisi)
Theme song: Hakodate Line by Blue Dot Sessions (https://app.sessions.blue/browse/track/111291" )

Programming Games with Shiny || Guess the Number || RStudio
00:00 Introduction 00:35 Setting up our app UI 06:19 Using observeEvent() 10:02 Writing an if else statement as part of our feedback mechanism 13:40 Testing our app and deciding which bugs to fix first 14:20 Check yourself before you req() yourself 17:10 Using tabset panels to control what the user sees
You’ve most likely used Shiny to build a web app that displays data, but you can also use Shiny to build games! In this video series, Jesse and Barret pair program simply games in Shiny as a way to uncover and explore new features.
Read up on tabset panels here: https://shiny.rstudio.com/reference/shiny/1.5.0/tabsetPanel.html
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) and Jesse Mostipak (@kierisi) Animation, motion design, and editing: Jesse Mostipak (@kierisi)
Theme song: Hakodate Line by Blue Dot Sessions (https://app.sessions.blue/browse/track/91291 )

Programming Games with Shiny || Dragon Realm || RStudio
00:00 Introduction 00:05 Fun dragon facts 00:35 Describing the Dragon Realm game 01:20 Outlining our approach 04:38 Coding the basics of our app 10:15 Programming our action buttons 14:10 A note on coding objects “outside” of Shiny 15:27 Programming cave choice logic 20:29 Connecting action buttons to our consequences function 29:40 Creating separate pages using tabsetPanel() 39:35 Conclusion
You’ve most likely used Shiny to build a web app that displays data, but you can also use Shiny to build games! In this video series, Jesse and Barret pair program simply games in Shiny as a way to uncover and explore new features.
And because we know you’ll ask, Jesse is using the Woodland theme from the base16 palette. You can get it - and other themes - from the {rsthemes} package: https://github.com/gadenbuie/rsthemes
Read up on tabset panels here: https://shiny.rstudio.com/reference/shiny/1.5.0/tabsetPanel.html
Learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) and Jesse Mostipak (@kierisi) Animation, motion design, and editing: Jesse Mostipak (@kierisi)
Intro music: RGift by Blue Dot Sessions (https://app.sessions.blue/browse/track/91282 ) Theme song: Hakodate Line by Blue Dot Sessions (https://app.sessions.blue/browse/track/91291 )

Barret Schloerke || Maximize computing resources using future_promise() || RStudio
00:00 Introduction 01:45 Setting up a multisession using the future package 02:05 Simulation using two workers 04:14 Simulation using 10 workers 05:20 What happens when we run out of workers? 05:35 How Shiny handles future processes like promises 07:16 Introduction to future_promise() 07:45 Demo of the promises package 09:21 Setting the number of workers 10:40 Demo of processing without future_promise() 14:11 Wrapping a slow calculation in a future() 14:53 Demo of processing using Plumber 16:25 Considerations on the number of cores to use 17:21 What happens if we run out of workers? 19:44 Decrease in execution times using future_promise()
In an ideal situation, the number of available future workers (future::nbrOfFreeWorkers()) is always more than the number of future::future() jobs. However, if a future job is attempted when the number of free workers is 0, then future will block the current R session until one becomes available.
The advantage of using future_promise() over future::future() is that even if there aren’t future workers available, the future is scheduled to be done when workers become available via promises. In other words, future_promise() ensures the main R thread isn’t blocked when a future job is requested and can’t immediately perform the work (i.e., the number of jobs exceeds the number of workers).
You can read more about the promises package here: https://rstudio.github.io/promises/articles/shiny.html And you can learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) Design and editing: Jesse Mostipak (@kierisi)

Barret Schloerke || {reactlog} Rundown || RStudio
00:00 Introduction to Reactlog 00:44 Viewing Reactlog using an Old Faithful Shiny app 02:07 The Reactlog interface 04:31 Walking through a reactive graph with Reactlog 05:14 Downstream dependency invalidation in Shiny 06:43 How Shiny “grabs” data 09:41 How the Reactlog timeline works 10:46 Switching between idle states in Reactlog 11:58 Reactlog interactivity - clicking a single item 13:21 Reactlog with the Pythagoras Theorem app 15:45 Adding a UI and server value to add Reactlog to your Shiny app 18:05 Walking through the reactive graph using the Pythagorean Theorem app 21:07 Append-only behavior of Reactlog 21:18 Marking a time point in Reactlog 23:17 Using Reactlog to debug reactivity 26:55 Resetting our app and testing logic changes 28:01 Reactlog with a large Shiny app, CRANwhales 34:10 Freezing reactive values 36:19 Calculating click count in a Shiny app 37:10 Click the button, render the plot is bad - see why
Shiny is an R package from RStudio that makes it incredibly easy to build interactive web applications with R. Behind the scenes, Shiny builds a reactive graph that can quickly become intertwined and difficult to debug. reactlog provides a visual insight into that black box of Shiny reactivity.
After logging the reactive interactions of a Shiny application, reactlog constructs a directed dependency graph of the Shiny’s reactive state at any time point in the record. The reactlog dependency graph provides users with the ability to visually see if reactive elements are:
- Not utilized (never retrieved)
- Over utilized (called independently many times)
- Interacting with unexpected elements
- Invalidating all expected dependencies
- Freezing (and thawing), preventing triggering of future reactivity
There are many subtle features hidden throughout reactlog. Here is a short list quickly describing what is possible within reactlog:
- Display the reactivity dependency graph of your Shiny applications
- Navigate throughout your reactive history to replay element interactions
- Highlight reactive family trees
- Filter on reactive family trees
- Search for reactive elements
You can read more about reactlog here: https://rstudio.github.io/reactlog/articles/reactlog.html And you can learn more about Shiny here: https://shiny.rstudio.com/
Got questions? The RStudio Community site is a great place to get assistance: https://community.rstudio.com/
Content: Barret Schloerke (@schloerke) Design & editing: Jesse Mostipak (@kierisi)

James Blaire & Barret Schloerke | Integrating R with Plumber APIs | RStudio (2020)
Full title: Expanding R Horizons: Integrating R with Plumber APIs
In this webinar we will focus on using the Plumber package as a tool for integrating R with other frameworks and technologies. Plumber is a package that converts your existing R code to a web API using unique one-line comments. Example use cases will be used to demonstrate the power of APIs in data science and to highlight new features of the Plumber package. Finally, we will look at methods for deploying Plumber APIs to make them widely accessible.
Webinar materials: https://rstudio.com/resources/webinars/expanding-r-horizons-integrating-r-with-plumber-apis/
About James: James is a Solutions Engineer at RStudio, where he focusses on helping RStudio commercial customers successfully manage RStudio products. He is passionate about connecting R to other toolchains through tools like ODBC and APIs. He has a background in statistics and data science and finds any excuse he can to write R code.
About Barret: I specialize in Large Data Visualization where I utilize the interactivity of a web browser, the fast iterations of the R programming language, and large data storage capacity of Hadoop

Barret Schloerke | Reactlog 2.0 Debugging the state of Shiny | RStudio (2019)
The revamped reactlog provides an updated visual display to traverse through the reactive behavior within your shiny application. Using live shiny applications, we will use reactlog’s directed dependency graph to find missing reactive dependencies in “working” applications and address suboptimal reactive coding patterns. Correcting these coding patterns will reduce the amount of calculations done by shiny and keep reactive objects from being created unnecessarily.
VIEW MATERIALS http://github.com/schloerke/presentation-2019-01-18-reactlog
About the Author Barret Schloerke I specialize in Large Data Visualization where I utilize the interactivity of a web browser, the fast iterations of the R programming language, and large data storage capacity of Hadoop




