library(tidyverse) library(PPBDS.data) library(learnr) library(shiny) knitr::opts_chunk$set(echo = FALSE, message = FALSE) options(tutorial.exercise.timelimit = 60, tutorial.storage="local")
``` {r name} question_text( "Student Name:", answer(NULL, correct = TRUE), allow_retry = TRUE, try_again_button = "Modify your answer", incorrect = "Ok" )
## Email ``` {r email} question_text( "Email:", answer(NULL, correct = TRUE), allow_retry = TRUE, try_again_button = "Modify your answer", incorrect = "Ok" )
Let's figure out where we are. To see your current folder, type pwd
(previews working directory). Hit return, and copy/paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Type ls
in the terminal and hit return to see all the items that are located in the bottom right window under "Home". Paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
We will be opening or "changing" into our Desktop directory now. Type in the command cd Desktop/
. Paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Awesome. Now type ls
. Paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Let's try making a folder called Gov-50. Use the command mkdir Gov-50
and hit return. Now type ls
to see your newly created folder! Paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Let's now create a file. Type in touch: text.txt
and hit return. Now type ls
. Paste both the line on which you typed the command and the line(s) below it
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Now let's move our text.txt file to our Gov-50 folder. Type mv test.txt Gov-50/
. Now let's check! Use cd
to open our Gov-50 folder and ls
to show its contents. Paste both the line on which you typed the command and the line(s) below it
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Try copying the test.txt file into your Gov-50 folder. Use cp test.txt Gov-50/
. Paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Now lets try removing that same text.txt file with rm
. Use ls
to make sure it is gone!
Let's check to see that you have git installed. To check, go to your Terminal and type git --version
. If you do not have git installed, follow the instructions here.
Now type git config --global user.name "Your Name"
into the terminal. Replace "Your Name" with your name. Copy/paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Now Type git config --global user.mail "your@email.com"
into the terminal. Replace "your@email.com" with the email you used to sign up for GitHub. Copy/paste both the line on which you typed the command and the line(s) below it.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Now, switch out of the terminal window into the console window. Install the package usethis
. Issue the command install.packages("usethis")
.
DO NOT go on until you have done this.
Type git_sitrep()
into the console. You will see a bunch of code divided into 5 sections. Copy/paste the first section under Git config (global).
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Awesome. Now copy/paste the third section under GitHub.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
For RStudio to make PDF files, your computer set up must be set up with a [LaTeX]. Open up your console, and install the package 'tinytex' using install.pacakges()
. Copy/paste both the line on which you typed the command and the line(s) below it
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Now open the tinytex
package using library()
. Then type search()
and paste below whatever shows up in your search box.
question_text("copy/paste here:", answer(NULL, correct = TRUE), incorrect = "Ok", try_again_button = "Modify your answer", allow_retry = TRUE)
Some of these exercises were taken from the collection of RStudio Primers, a great resource for practicing your skills.
submission_ui
submission_server()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.