Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lesson Template
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
prace-lessons
Lesson Template
Commits
cf68fcbb
Commit
cf68fcbb
authored
8 years ago
by
Greg Wilson
Browse files
Options
Downloads
Plain Diff
Merge branch '2016-06' of github.com:swcarpentry/lesson-example into 2016-06
parents
6bb7b27a
014563f8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
_episodes_rmd/06-rmarkdown-example.Rmd
+64
-0
64 additions, 0 deletions
_episodes_rmd/06-rmarkdown-example.Rmd
with
64 additions
and
0 deletions
_episodes_rmd/06-rmarkdown-example.Rmd
0 → 100644
+
64
−
0
View file @
cf68fcbb
---
title: "Demonstration of a lesson written using RMarkdown"
teaching: 10
exercises: 2
questions:
- "How to write a lesson using RMarkdown?"
objectives:
- "Explain how to use RMarkdown with the new lesson template."
- "Demonstrate how to include pieces of code, figures, and challenges."
keypoints:
- "It shouldn't be difficult"
---
This episode demonstrates all the features that can be used when writing a
lesson in RMarkdown.
This first chunk is really important, and should be included in all markdown lessons.
```{r, echo=FALSE}
source("../bin/chunk-options.R")
```
The rest of the lesson should be written as a normal RMarkdown file. You can
include chunk for codes, just like you'd normally do:
Normal output:
```{r}
1 + 1
```
Output with error message:
```{r}
x[10]
```
Output generating figures:
```{r plot-example}
library(ggplot2)
ggplot(diamonds, aes(x = carat, y = price, color = cut)) +
geom_point()
```
For the challenges and their solutions, you need to pay attention to the where
the `>` go and where to leave blank lines. Otherwise, you can include chunks in
it to include instructions and solutions.
> ## Challenge: Can you do it?
>
> What is the output of this command?
>
> ```{r, eval=FALSE}
> paste("This", "new", "template", "looks", "good")
> ```
>
> > ## Solution
> >
> > ```{r, echo=FALSE}
> > paste("This", "new", "template", "looks", "good")
> > ```
> {: .solution}
{: .challenge}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment