library(tidyverse)
library(learnr)
library(shiny)
library(PPBDS.data)
knitr::opts_chunk$set(echo = FALSE, message = FALSE)
options(tutorial.exercise.timelimit = 60, tutorial.storage="local") 

Chapter 00 tutorial

Welcome to your first tutorial. The goal of this exercise is to answer some questions about the shopping week chapter and to learn how to complete and submit a tutorial. Begin by filling out your name and clicking the submit button. If you made a mistake, you click "Try Again" and edit your name.

``` {r name, echo=FALSE} question_text( "Student Name:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE )

For our first exercise, we'll do some simple math in our console. We've already assigned variables x to 5 and y to 4. On the next line, add the two variables by typing "x + y", but with no quotes. Hit "Run Code" to see the output of your addition. Clicking "Hint" gives you a hint about what to type into the console. Clicking "Start Over" clears the console and allows you to begin again.

```r
x <- 5
y <- 4
x + y

Check the version of R running on your computer. You can do this by copy-pasting version[['version.string']] into your console and hit "Run Code". You will use the output of this line of code to answer the following question.


version[['version.string']]

Here is a different type of question you will encounter in tutorials: multiple choice. If you get the wrong answer for this question, you haven't installed the most recent version of R and should redo the steps from chapter 00. If you click the wrong answer in general on multiple choice questions, you can hit "Try Again" for another attempt.

question("What is the R version running on your computer?",
    answer("4.0.2", correct = TRUE),
    answer("4.0.1"),
    answer("4.0.0"),
    answer("3.9.9"),
    allow_retry = TRUE)

At this point, we want to know if your machine saves your progress on tutorials. Close your tutorial and restart your R session, then open up this tutorial again. Was your progress on the first three questions saved? If not, ask for help on setting up tutorials. (Note that, if you are working on RStudio Cloud, progress will not be saved.)

Now, we are going to load our first dataset. We've already loaded the PPBDS.data in the package -- this is the package our dataset will come from. Type trains in the console and hit "Run Code". This should display some observations from the trains dataset.

library(PPBDS.data)
trains

Submit

submission_ui
submission_server()


davidkane9/PPBDS.data documentation built on Nov. 18, 2020, 1:17 p.m.