5.6 Tutorial practice activities

This activity will help reinforce each of the key learning outcomes from this tutorial.


You are going to take measurements of the lengths (in mm) of your thumb, index finger, and middle finger on each hand; but don’t start measuring yet!


  • Create a new R Markdown document for this practice activity. This is where you’ll record the procedures you use for this practice activity
  • As we’ve learned in previous tutorials, one of the first steps we should do is include a code chunk in the markdown document in which we load any packages we’ll need.
  • Include a code chunk to load the packages used in the present tutorial
  • Save the R Markdown document in your root “BIOL202_tutorials” directory, and provide it an appropriate file name.
  • Open a new blank spreadsheet in Excel

Before taking the measurements, think about how you can make your measurement procedure reproducible. Where exactly are you measuring from and to on each digit? Are you using a ruler? What’s your measurement precision? Whatever approach you take, make sure you type it out clearly in your R Markdown document, so that someone else could repeat it.

  • Also before you start measuring, think about how you’ll organize the data in the spreadsheet, including how many variables you’ll have, what to name those variables, and how many rows or observations you’ll have.

HINT: Even before you start measuring, most of your data sheet should be filled with values, and when you type in your 6 measurements, these should be entered in a single column.

  • Once you’ve organized the spreadsheet, and even before you start entering the digit measurements, save it as a CSV file into your “rawdata” folder, remembering to use an appropriate file name
  • Once you’ve typed out the methods in your markdown document, you can start taking measurements and recording them in the spreadsheet
  • Once you’ve finished entering the data, save the spreadsheet again, then quit Excel.

Now would be a good time to create and edit a “_README.txt” file for your new “rawdata” folder.

Now you’re ready to import the data into R.

  • In your R Markdown document, include a code chunk to import the data.

Now you’re ready to get an overview of the data.

  • In your R Markdown document, include a code chunk to get an overview of the dataset.

Once you’ve confirmed that each of the code chunks work in your R Markdown document, you’re ready to knit!

  • Knit your document to PDF.

All done!