learnr
learnr is an R package that converts R Markdown documents into interactive tutorials with exercises, quizzes, and videos. It lets learners write and execute code directly in the browser, with automatic progress saving. Designed primarily for teaching R, statistics, and data science topics.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | rstudio/learnr |
| Owner | rstudio |
| Primary language | R |
| License | Apache-2.0 — OSI-approved |
| Stars | 736 |
| Forks | 241 |
| Open issues | 152 |
| Latest release | v0.11.6 (2025-11-13) |
| Last updated | 2025-11-13 |
| Source | https://github.com/rstudio/learnr |
What learnr is
learnr extends R Markdown to create interactive web-based tutorials using Shiny components for code execution and form validation. It supports embedded code exercises, quiz questions, video embeds (YouTube/Vimeo), and session-level progress persistence. Built on rmarkdown and Shiny ecosystems.
Get the learnr source
Clone the repository and explore it locally.
git clone https://github.com/rstudio/learnr.gitcd learnr# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- R and RStudio (or Shiny Server) are mandatory dependencies; ensure your infrastructure can host and scale them appropriately.
- Tutorials execute arbitrary R code server-side; untrusted user input or compute-heavy exercises could exhaust resources. Implement resource limits and code sandboxing if hosting for external users.
- learnr does not provide built-in user authentication, role management, or audit logging. Layer these yourself or use a reverse proxy (e.g., Shiny Server Pro).
- Progress is stored in browser session/local storage by default; persistent learner tracking requires custom backend integration.
- Interactive Shiny components add runtime overhead. Complex tutorials with many concurrent users may require load balancing and tuned Shiny configuration.
When to avoid it — and what to weigh
- Non-R Technical Stacks — learnr is R-centric. If your primary language is Python, Java, or JavaScript, this tool adds friction. Other environments may be better integrated with non-R tech stacks.
- Large-Scale Multi-Tenant SaaS — learnr is not a learning management system (LMS). For high-volume user tracking, compliance reporting, role-based access, or tight SaaS isolation, you need dedicated platform infrastructure.
- Real-Time Collaborative Editing — learnr tutorials are single-user, single-session workspaces. No built-in support for live pair programming, instructor monitoring, or collaborative code execution.
- Restricted Deployment Environments — Requires R runtime and Shiny server. If your target environment cannot run R (e.g., heavily restricted cloud, air-gapped networks), this won't fit without significant infrastructure work.
License & commercial use
Apache License 2.0 (Apache-2.0). A permissive OSI-approved license allowing commercial use, modification, and distribution with attribution and liability disclaimers.
Apache-2.0 permits commercial use of learnr itself (bundling, reselling, offering as part of a service). However, verify your use case does not conflict with other dependencies (e.g., Shiny Server Pro licensing if you use it). No warranty is provided; ensure your liability model aligns with Apache terms.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Strong |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
learnr runs R code server-side on user input. Key risks: (1) Code injection if user input is unsanitized; (2) Resource exhaustion (CPU, memory) from malicious or careless R operations; (3) Unauthorized data access if the R process has file system or network permissions. Mitigation: isolate R processes, restrict permissions, validate/sandbox code where possible, and audit session logs. No cryptographic features or encryption mentioned; assume data in transit and at rest is only as secure as your hosting environment and R session isolation.
Alternatives to consider
Jupyter Notebooks / JupyterHub
Language-agnostic, supports Python/R/Julia, stronger for reproducible research. More complex to deploy at scale; less opinionated pedagogy framework.
Posit Cloud (formerly RStudio Cloud)
Hosted alternative to learnr; managed R environment with no infrastructure burden. Proprietary SaaS model; less fine-grained control over content and user isolation.
Dataquest / Coursera / Udacity
Full-featured learning platforms with built-in progress tracking, quizzing, and compliance. Higher cost; less customization for domain-specific workflows.
Build on learnr with DEV.co software developers
learnr simplifies creating hands-on coding courses with automatic progress saving and instant feedback. Evaluate your hosting model (local, Shiny Server, or managed cloud) and assess custom integrations for user tracking and compliance.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
learnr FAQ
Can I deploy learnr tutorials without RStudio or Shiny Server?
Does learnr track user progress and grades?
Can I embed learnr tutorials in an LMS like Canvas?
Is learnr suitable for Python instructors?
Work with a software development agency
From first prototype to production, DEV.co delivers software development services around tools like learnr. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source databases and beyond.
Ready to Build Interactive R Tutorials?
learnr simplifies creating hands-on coding courses with automatic progress saving and instant feedback. Evaluate your hosting model (local, Shiny Server, or managed cloud) and assess custom integrations for user tracking and compliance.