# install.packages('pak')
pak::pak('mjfrigaard/shinypak')
library(shinypak)Shiny LLM Tools
Since I began writing this book1, the number of AI tools for building Shiny apps has grown significantly. The chapters in this section introduce a few popular tools I’ve personally used to develop applications in Positron 
.
R & LLM Resources
I highly recommend checking out the resources below if you’re new to LLMs in R:
Talks
R in Pharma 2025 had two talks on using Positron with LLMS (Positron Assistant for Developing Shiny Apps by Tom Mock and Building the Future of Data Apps: LLMs Meet Shiny by Garrick Aiden-Buie).
Hadley Wickham’s userR keynote talk (I wrote this talk with an LLM) is a great place to start if you’d like an overview of LLMs, some common jargon, and how they can be used to increase productivity.
Winston Chang’s AI and Shiny talk at ShinyConf covers LLM packages developed by Posit (
ellmerandchatlas), the mechanics of an LLM conversation, tool calling, Shiny Assistant and the VS Code Shiny Assistant.Joe Cheng has an excellent R/Medicine 2025 workshop (Demystifying LLMs with Ellmer) that covers a lot of the same material as the talk above, but dives deeper into a practical example (repo and slides).
Books/Blogs
For a comprehensive review of LLMs R packages, please checkout Large Language Model tools for R online resource by Luis D. Verde Arregoitia.
For the most up-to-date information on LLMs and R, I recommend Simon Couch’s blog and Posit’s AI blog.
Given the rapidly evolving landscape and nature of these tools, I expect these chapters to change frequently. Please open a GitHub issue if there is anything outdated, incorrect, or missing.
Shiny Assistant
The Shiny Assistant is a browser-based LLM chat tool you can use to help build a Shiny app. The UI gives you the ability to submit prompts (questions or instructions), view the code, and launch the application. 26 Shiny Assistant covers:
ellmer
The ellmer package allows users to,
“Chat with large language models from a range of providers including ‘Claude’ https://claude.ai, ‘OpenAI’ https://chatgpt.com, and more. Supports streaming, asynchronous calls, tool calling, and structured data extraction.”
This chapter starts with setting up the ellmer package.
To demonstrate using ellmer chats during development, this chapter uses an application from the shiny-examples repository.
chores
The chores package was designed to,
“help you complete repetitive, hard-to-automate tasks quickly.”
The first portion of this chapter covers the updates to the movie review application:
I also cover how to write extension packages with custom helper (prompts) that can be used with the addin.
gander
The gander package is,
“a higher-performance and lower-friction chat experience for data scientists in RStudio and Positron–sort of like completions with Copilot, but it knows how to talk to the objects in your R environment.”
This chapter starts with configuring gander and a simple example:
The following sections cover the structure of gander prompts and chats:
I extend the use of the gander addin to help make adjustments to the plotly and ggplot2 visualizations, and to create a downloadable R markdown report module:
btw
The btw package,
“helps you describe your computational environment to LLMs.”
I put the first ‘complete’ edition online in late 2023.↩︎