adventr
?The adventr
package
[fieldAdventureStatisticsReality2016] contains a series of interactive
tutorials that teach alongside chapters of my 2016 textbook An
Adventure in Statistics: the reality enigma. The tutorials are
written using a package called learnr. Once a tutorial is
running it’s a bit like reading a book but with places where you can
practice the R code that you have just been taught. The
adventr
package is free (as are all things -related) and
offered to support tutors and students using my textbook who want to
learn R.
R is a free software environment for statistical analysis and graphics. is a user interface through which to use . adds functionality that make working with easier, more efficient, and generally more pleasant than working in alone.
You can get started with R and RStudio by completing this tutorial (includes videos):
adventr
The package was written initially to support my own teaching on a module where I base the content around An Adventure in Statistics. One quirk of this is that there are some advanced tutorials on topics not covered in the book (but continue the themes of the book …). Another quirk is that - at present - there are some chapters that don’t have associated tutorials (for example, the Chapter on probability).
The tutorials are named to correspond (roughly) to the relevant chapter of the book. For example, adventr_03 would be a good tutorial to run alongside teaching related to chapter 3, and so on.
adventr
To use adventr
you first need to install and . To learn
how to do this and to get oriented with and complete
my interactive tutorial, getting
started with R and RStudio. Once you have installed and you can
install adventr
.
You can install the latest official release of adventr
from CRAN in the usual way. Note that you should include
dependencies = TRUE
to also install the packages used in
the tutorials on your system. If you omit this argument, you will need
to manually install these packages (which you won’t want to do, trust
me).
install.packages("adventr", dependencies = TRUE)
If you want the very latest development version, you can install it from GitHub by executing (in ):
if(!require(devtools)){
install.packages("devtools")
}
devtools::install_github("profandyfield/adventr", dependencies = TRUE)
In Version 1.3 onwards there is a tutorial pane. Having executed
library(adventr)
A list of tutorials appears in this pane. Scroll through them and click on the button to run the tutorial:
Alternatively, to run a particular tutorial from the console execute:
library(adventr)
learnr::run_tutorial("name_of_tutorial", package = "adventr")
and replace “name of tutorial” with the name of the tutorial you want to run. For example, to run tutorial 3 (for Chapter 3) execute:
learnr::run_tutorial("adventr_03", package = "adventr")
The name of each tutorial is in bold in the list above. Once the command to run the tutorial is executed it will spring to life in the tutorial pane.
The tutorials are self-contained (you practice code in code boxes) so you don’t need to use at the same time. However, to get the most from them I would recommend that you create an project and within that open (and save) a new RMarkdown file each time to work through a tutorial. Within that Markdown file, replicate parts of the code from the tutorial (in code chunks) and use Markdown to write notes about what you have done, and to reflect on things that you have struggled with, or note useful tips to help you remember things. Basically, write a learning journal. This workflow has the advantage of not just teaching you the code that you need to do certain things, but also provides practice in using itself.
Here’s a video explaining how I suggest you use the tutorials:
Copyright © 2000-2019, Professor Andy Field.