Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(exercise): Support exercise.pipe option #804

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

gadenbuie
Copy link
Member

Globally choose pipe characters, or set them per exercise. Default is chosen based on the current version of R in the rendering environment.

Supersedes #786


You can set the characters used for the pipe shortcut at the tutorial level with

knitr::opts_chunk$set(exercise.pipe = "%>%")

Or you can set the pipe option at the individual level using the exercise.pipe chunk option.

```{r base-pipe, exercise=TRUE, exercise.pipe="|>"}
mtcars count(cyl)
```

By default, if not set otherwise set, learnr will use the base R pipe (|>) when the tutorial is rendered in R >= 4.1.0.

Globally choose pipe characters, or set them per exercise. Default is chosen based on the current version of R in the rendering environment.
@gadenbuie gadenbuie merged commit 20e4cb6 into main Sep 27, 2023
13 checks passed
@gadenbuie gadenbuie deleted the feat/native-pipe-shortcut branch September 27, 2023 20:00
@statik
Copy link

statik commented Sep 27, 2023

@gadenbuie thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants