Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

use_tutorial

Create a learnr tutorial


Description

Creates a new tutorial below inst/tutorials/. Tutorials are interactive R Markdown documents built with the learnr package. use_tutorial() does this setup:

  • Adds learnr to Suggests in DESCRIPTION.

  • Gitignores inst/tutorials/*.html so you don't accidentally track rendered tutorials.

  • Creates a new .Rmd tutorial from a template and, optionally, opens it for editing.

  • Adds new .Rmd to .Rbuildignore.

Usage

use_tutorial(name, title, open = rlang::is_interactive())

Arguments

name

Base for file name to use for new .Rmd tutorial. Should consist only of numbers, letters, _ and -. We recommend using lower case.

title

The human-facing title of the tutorial.

open

Open the newly created file for editing? Happens in RStudio, if applicable, or via utils::file.edit() otherwise.

See Also

Examples

## Not run: 
use_tutorial("learn-to-do-stuff", "Learn to do stuff")

## End(Not run)

usethis

Automate Package and Project Setup

v2.0.1
MIT + file LICENSE
Authors
Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Jennifer Bryan [aut, cre] (<https://orcid.org/0000-0002-6983-2759>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.