Learn R Programming

swirlify

swirlify is an R package that includes tools for writing and sharing swirl courses. For more information on swirl, visit our website or our GitHub repository.

Installation

CRAN Version

install.packages("swirlify")

Development Version

library(devtools)
install_github("swirldev/swirlify", ref = "dev")

Quick Start

We highly recommend using RStudio for authoring swirl content.

library(swirlify)

# Create a new lesson and a new course
new_lesson("My Lesson", "My Course")

# Add content to the lesson in a text editor

# When you are finished writing your lesson, add it to the course manifest
add_to_manifest()

# Convret your course into a `.swc` file so you can share it easily.
pack_course()

Documentation

For extensive documentation on swirlify and tips for writing swirl courses see the swirlify website.

Course structure

swirl courses have the following structrue:

  • Courses are directories that contain all of the files, folders, and lessons

associated with the course you are developing. The name of the course directory is the name of the course. For example the name of the directory that contains Team swril's R Programming course is named R_Programming.

  • Lessons are directories that contain single units of instruction. The

name of a lesson directory is the name of that lesson. Every lesson must at least contain a lesson.yaml file containing lesson content.

  • Questions are written inside of the lesson.yaml file in each lesson

directory. Students are prompted with questions in sequential order.

Contact

If you have any questions about using swirlify don't hesitate to reach out to us: info@swirlstats.com

Copy Link

Version

Install

install.packages('swirlify')

Monthly Downloads

268

Version

0.5.3

License

MIT + file LICENSE

Maintainer

Sean Kross

Last Published

May 28th, 2019

Functions in swirlify (0.5.3)

make_pathname

Replace spaces in strings with underscores
wq_message

Template for output without a question
lesson_to_html

Turn a swirl lesson into a pretty webpage
add_to_manifest

Add current lesson to course manifest
wq_multiple

Template for multiple choice question
unpack_course

Unpack an .swc file into a swirl course
testit

(Deprecated)
swirl_courses_dir

Find the directory where swirl courses are stored
test_course

Run tests on a course
swirlify

Launch a Shiny application for writing swirl lessons
test_lesson

Run tests on a lesson
wq_text

Template for text question
demo_lesson

Demo the current lesson in swirl
wq_video

Template for video question
pack_course

Create an .swc file of the course you are working on
set_lesson

Select an existing lesson to work on
wq_numerical

Template for exact numerical question
wq_script

Template for R script question
count_questions

Count number of questions in current lesson
new_lesson

Create new lesson in the YAML format.
google_form_decode

Decode Student's Submissions from Google Forms
add_license

Add a LICENSE.txt file to your course
find_questions

Get question numbers for any questions matching a regular expression
wq_command

Template for R command question
get_current_lesson

See what lesson you are currently working on
wq_figure

Template for figure questions