blastula
Easily send great-looking HTML email messages from R
Blastula is an R package for creating and sending HTML emails directly from R. It provides a composable interface with three content areas (body, header, footer) where you can insert Markdown text, HTML fragments, and R objects from your workspace.
The package generates responsive HTML/CSS that renders correctly across different email clients and devices. It supports SMTP sending with credential management and integrates with Posit Connect for automated email workflows. You can embed images, use dynamic content with glue, and preview emails in RStudio before sending.
Contributors#
Resources featuring blastula#
Scale Your Data Validation Workflow With {pointblank} and Posit Connect - posit::conf(2023)
Presented by Michael Garcia
For the Data Services team at Medable, our number one priority is to ensure the data we collect and deliver to our clients is of the highest quality. The {pointblank} package, along with Posit Connect, modernizes how we tackle data validation within Data Services.
In this talk, I will briefly summarize how we develop test code with {pointblank}, share with {pins}, execute with {rmarkdown}, and report findings with {blastula}. Finally, I will show how we aggregate data from test results across projects into a holistic view using {shiny}.
Presented at Posit Conference, between Sept 19-20 2023, Learn more at posit.co/conference.#
Talk Track: Leave it to the robots: automating your work. Session Code: TALK-1058
Model Monitors and Alerting at Scale with RStudio Connect | Adam Austin, Socure
Deploying a predictive model signals the end of one long journey and the start of another. Monitoring model performance is crucial for ensuring the long-term quality of your work.
A monitor should provide insights into model inputs and output scores, and should send alerts when something goes wrong. However, as the number of deployed models increases or your customer base grows, the maintenance of your monitor portfolio becomes daunting. In this talk we’ll explore a solution for orchestrating monitor deployment and maintenance using RStudio Connect. I will show how applications of R Markdown, Shiny, and Plumber can unburden data scientists of time-consuming report upkeep by empowering end-users to deploy, update, and own their monitors.
Timestamps: 2:01 - Start of presentation 3:43 - About Socure 6:12 - Model performance matters, deployment isn’t the end of the story 7:26 - What is a monitor? 8:55 - What is an alert? 11:00 - Monitor example 18:09 - Firing an alert from RStudio Connect 19:00 - Why monitor from RStudio Connect? 24:33 - How monitoring drives success at Socure 30:00 - Git-backed deployment in RStudio Connect 36:00 - Shiny app that their account managers see 46:00 - Architecture of a monitoring system 56:00 - Connect hot tip System-wide packages 57:00 - Why did we try Connect for monitoring 59:02 - Why do we keep using it for that :)
Resources shared: Blastula package: https://github.com/rstudio/blastula connectapi package: https://github.com/rstudio/connectapi rsconnect package: https://rstudio.github.io/rsconnect/ Intro to APIs blog post: https://www.rstudio.com/blog/creating-apis-for-data-science-with-plumber/
Speaker Bio: Adam Austin is a senior data scientist and RStudio administrator at Socure, a leading provider of identity verification and fraud prevention services. His work focuses on data science enablement through tools, automation, and reporting
Veerle van Leemput | Analytic Health | Optimizing Shiny for enterprise-grade apps
Can you use Shiny in production? A: Yes, you definitely can.
Link to slides: https://github.com/RStudioEnterpriseMeetup/Presentations/blob/main/VeerlevanLeemput-OptimizingShiny-20220525.pdf
Packages mentioned: ⬢ shiny: https://shiny.rstudio.com/ ⬢ pins: https://pins.rstudio.com/ ⬢ plumber: https://www.rplumber.io/ ⬢ blastula: https://github.com/rstudio/blastula ⬢ callR: https://github.com/r-lib/callr ⬢ shinyloadtest: https://rstudio.github.io/shinyloadtest/ ⬢ shinycannon: https://github.com/rstudio/shinycannon ⬢ shinytest2: https://rstudio.github.io/shinytest2/ ⬢ feather: https://github.com/wesm/feather ⬢ shinipsum: https://github.com/ThinkR-open/shinipsum ⬢ bs4Dash: https://rinterface.github.io/bs4Dash/index.html
Timestamps: 2:44 - Start of presentation 5:41 - What qualifies as an enterprise-grade app? 10:46 - UI first / user experience / prototyping 13:20 - Separating code into separate scripts and creating code that’s easy to test 17:15 - Golem 19:28 - Functionize your code 20:50 - Rhino package, framework for developing enterprise-grade apps at speed 22:33 - Infrastructure, how do you bring this to your users? (lots of ways to do this. They do this with R, pins, plumber, rmd, blastula, and Posit Connect on Azure) 31:17 - Optimizing Shiny (process configuration, cache, callR, API, feather) 47:35 - Testing your app (shinyloadtest and shinycannon) 50:23 - Testing for outcomes (shinytest2) 52:15 - Monitor app performance & usage (blastula, shinycannon, usage metrics with Shiny app)
Questions: 57:38 - What’s the benefit of using pins rather than pulling the data from your database? 59:30 - Are there package license considerations you had to think about when monetizing shiny applications? 1:00:45 - Do you use promises to scale the application? (they use CallR) 1:01:49 - For beginners, golem or rhino? 1:02:50 - The myth is that only Python can be used for production apps, what made you choose to use R? 1:05:12 - Is feather strictly better than using JSON? 1:06:38 - Where do you see the line between BI (business intelligence) and Shiny for your applications? 1:08:36 - Any tips for enterprise-grade UI development? Making beautiful apps (bs4Dash app) 1:10:25 - Have you found an upper limit for users? 1:12:19 - Any tips for more dynamic data? (optimizing database helps here) 1:13:50 - Where do you install shinycannon? (on our development Linux server) 1:15:00 - Can you share other resources or examples of code? (Slides here with resources: https://github.com/RStudioEnterpriseMeetup/Presentations/blob/main/VeerlevanLeemput-OptimizingShiny-20220525.pdf )
For upcoming events: rstd.io/community-events-calendar Info on Posit Connect: https://www.rstudio.com/products/connect/ To chat with Posit: rstd.io/chat-with-rstudio
R Markdown Advanced Tips to Become a Better Data Scientist & RStudio Connect | With Tom Mock
R Markdown is an incredible tool for being a more effective data scientist. It lets you share insights in ways that delight end users.
In this presentation, Tom Mock will teach you some advanced tips that will let you get the most out of R Markdown. Additionally, RStudio Connect will be highlighted, specifically how it works wonderfully with tools like R Markdown.
Please provide feedback: https://docs.google.com/forms/d/e/1FAIpQLSdOwz3yJluPR2fEqE0hBt92NtKZzzNACR8KJhHUt9rhFj3HqA/viewform?usp=sf_link
More resources if you’re interested: https://docs.google.com/document/d/1VKGs1G9GcQcv4pCYFbK68_LDh72ODiZsIxXLN0z-zD4/edit
04:15 Literate Programming 09:00 - Rstudio Visual Editor Demo 15:44 - R and python in same document via {reticulate} 18:10 - Q&A: Options for collaborative editing (version control, shared drive etc.) 19:30 - Q&A: Multi-pane support in Rstudio 20:46 Data Product (reports, presentations, dashboards, websites etc.) 24:15 - Distill article 26:27 - Xaringan presentation (add three dashes — for new slide) 28:58 - Flexdashboard (with shiny) 30:30 - Crosstalk (talk between different html widgets instead of {shiny} server) 35:03 - Q&A: Jobs panel – parallelise render jobs in background 36:50 - Q&A: various data product packages, formats 39:35 Control Document (modularise data science tasks, control code flow) 39:58 - Knit with Parameters (YAML params: option) 41:20 - Reference named chunks from .R files (knitr::read_chunk()) 43:00 - Child Documents (reuse content, conditional inclusion, {blastula} email) 47:07 Templating (don’t repeat yourself) 47:38 - rmarkdown::render() with params, looping through different param combinations 49:30 - Loop templates within a single document 50:40 - 04-templating/ live code demo 54:37 - {whisker} vs {glue} – {{logic-less}} vs {logic templating} 55:30 - {whisker} for generating markdown files that you can continue editing 57:49 RMarkdown + Rstudio Connect 1:00:41 Follow-up Reading and resources 1:04:49 Q&A - {shiny} apps, {webshot2} for screenshots of html, reading in multiple .R files, best practice for producing MSoffice files, {blastula}
Webinar Summary | Avoid Dashboard Fatigue | RStudio (2020)
0:00 Introduction 0:07 The Problem 1:05 The Solution 3:20 Real Life Success Stories 5:27 Demo (with code)
Don’t have an hour to watch a webinar? We’ve made a summary video that covers the main points of our “Avoid Dashboard Fatigue” webinar from Sean Lopp and Rich Iannone.
The full webinar covered: Data science teams face a challenging task. Not only do they have to gain insight from data, they also have to persuade others to make decisions based on those insights. To close this gap, teams rely on tools like dashboards, apps, and APIs. But unfortunately data organizations can suffer from their own success - how many of those dashboards are viewed once and forgotten? Is a dashboard of dashboards really the right solution? And what about that pesky, precisely formatted Excel spreadsheet finance still wants every week?
In this webinar, we’ll show you an easy way teams can solve these problems using proactive email notifications through the blastula and gt packages, and how RStudio pro products can be used to scale out those solutions for enterprise applications. Dynamic emails are a powerful way to meet decision makers where they live - their inbox - while displaying exactly the results needed to influence decision-making. Best of all, these notifications are crafted with code, ensuring your work is still reproducible, durable, and credible.
We’ll demonstrate how this approach provides solutions for data quality monitoring, detecting and alerting on anomalies, and can even automate routine (but precisely formatted) KPI reporting.
Webinar materials: https://rstudio.com/resources/webinars/avoid-dashboard-fatigue/
About Sean: Sean has a degree in mathematics and statistics and worked as an analyst at the National Renewable Energy Lab before making the switch to customer success at RStudio. In his spare time he skis and mountain bikes and is a proud Colorado native.
About Rich: My background is in programming, data analysis, and data visualization. Much of my current work involves a combination of data acquisition, statistical programming, tools development, and visualizing the results. I love creating software that helps people accomplish things. I regularly update several R package projects (all available on GitHub). One such package is called DiagrammeR and it’s great for creating network graphs and performing analyses on the graphs. One of the big draws for open-source development is the collaboration that comes with the process. I encourage anyone interested to ask questions, make recommendations, or even help out if so inclined!

Sean Lopp & Rich Iannone | Avoid Dashboard Fatigue | RStudio (2020)
Data science teams face a challenging task. Not only do they have to gain insight from data, they also have to persuade others to make decisions based on those insights. To close this gap, teams rely on tools like dashboards, apps, and APIs. But unfortunately data organizations can suffer from their own success - how many of those dashboards are viewed once and forgotten? Is a dashboard of dashboards really the right solution? And what about that pesky, precisely formatted Excel spreadsheet finance still wants every week?
In this webinar, we’ll show you an easy way teams can solve these problems using proactive email notifications through the blastula and gt packages, and how RStudio pro products can be used to scale out those solutions for enterprise applications. Dynamic emails are a powerful way to meet decision makers where they live - their inbox - while displaying exactly the results needed to influence decision-making. Best of all, these notifications are crafted with code, ensuring your work is still reproducible, durable, and credible.
We’ll demonstrate how this approach provides solutions for data quality monitoring, detecting and alerting on anomalies, and can even automate routine (but precisely formatted) KPI reporting.
Webinar materials: https://rstudio.com/resources/webinars/avoid-dashboard-fatigue/
About Sean: Sean has a degree in mathematics and statistics and worked as an analyst at the National Renewable Energy Lab before making the switch to customer success at RStudio. In his spare time he skis and mountain bikes and is a proud Colorado native.
About Rich: My background is in programming, data analysis, and data visualization. Much of my current work involves a combination of data acquisition, statistical programming, tools development, and visualizing the results. I love creating software that helps people accomplish things. I regularly update several R package projects (all available on GitHub). One such package is called DiagrammeR and it’s great for creating network graphs and performing analyses on the graphs. One of the big draws for open-source development is the collaboration that comes with the process. I encourage anyone interested to ask questions, make recommendations, or even help out if so inclined!
