Syllabus: R as a Research Tool (BIOL 6325)

Course Overview

Room and Time:

12:30-1:50 T TH

Online via Zoom. Dr. Schwilk will email a Zoom invitation.

Office hours:

Wednesday 2:30 – 3:30 PM or by appointment

Course Description

This is a workshop course in which I will teach the computer language “R”, an open-source, interactive software package specifically designed for scientific numerical computation. R is a language designed around a core set of statistical libraries and offers advanced statistical capabilities. The language also offers very good graphical capabilities for exploring data or preparing figures for presentations and publication. Additionally, the course will teach basic computer programming principles that can apply to other computer languages such as Python or C++. This is not a statistics course, but is aimed at teaching you to use R for data science. Therefore, I will cover visualization, data shaping, and model fitting in addition to the traditional programming subjects. My goal is to provide graduate students with tools to become better users of computers — programming allows a scientist to use the computer to answer the questions that are most important to the researcher and not be limited by pre-packaged tools.

There are no prerequisites.

Expected Learning Outcomes

The overarching goal of this course is to produce scientists who can efficiently and accurately investigate data and do so in an open and reproducible workflow.

After completion of the course students will be able to

  • use the console as a calculator and assign variables.
  • use and understand the R data types (vectors, matrices, dataframes, strings).
  • write functions in R and break a problem into a set of functions.
  • Search for and install domain-specific R packages and be able to use the documentation of such packages.
  • take a new data set and efficiently investigate it for patterns using data reshaping techniques and exploratory visualization.
  • produce publication-quality figures.
  • be fluent in some programming concepts especially important in data analysis.
  • have some familiarity but not necessarily fluency with other programming concepts such as functional programming style, object-oriented programming, recursion, and regular expressions.
  • Engage in good code and data organization practices and use a consistent programming style.
  • use a text editor and produce a plain-text workflow.
  • understand the basics of reproducible research including passing familiarity with version control and RMarkdown so that the student could go on learn more about these subjects easily..

Methods of Assessing Learning Outcomes

There will be no exams or final projects. Evaluations will be based solely on completion of weekly assignments. I will provide detailed feedback on the code students turn in each week.

Grading scale:

The final grade will be based on the average of the weekly programming assignments. I will first drop the lowest score. Grading framework: A => 90%; B => 80%; C 70%; D => 60%; F < 60%

Resources, required supplies


You will need to install on your own computer:

  1. Download and install R,
  2. Download and install RStudio,
  3. Install required packages:
pkgs <- c("tidyverse", "Lahman", "lubridate", "maps", "nlme", "pbkrtest", "RColorBrewer"


Course Outline

Week 1 Basic R features; introduction to the main data types and visualization
Week 2 More on vectors and other data types
Week 3 Introduction to functions. More on lists and data frames
Week 4 Programming structures: relational and logical operations; flow control
Week 5 Environment and scope, more on data frames
Week 6 Math and simulations in R
Week 7 Debugging, introduction to strings and regular expressions
Week 9 Introduction to graphics
Week 10 the Grammar of Graphics
Week 8 Data shaping and transformation; split-transform-recombine
Week 11 Reshaping and tidying data, exploring large data sets
Week 12 Dates and times, statistical models in R
Week 13 Overview of main domain-specific libraries
Week 14 TBA


Out-of-class assignments will be given on a weekly basis. For each assignment, please turn in a well-documented R script (email to me). I may also ask for specific outputs and test run results or graphs. Name each file starting with your last name, underscore, first name, then a hyphen and the homework name. Use the “.R” extension for R scripts, (e.g., if I were to submit the first assignment I would name the file Schwilk_Dylan-HW01.R). When emailing your assignment to me, please use a subject line with the following format: “R-research-tool: HW01”. In fact, please use “R-research-tool:” as a preface to the subject line for any email you send regarding the class.

There will be 12 assignments. Each assignment will be worth ~20 points. I will drop the lowest grade so the total points available will be around 220.

  • Sept 1. Vectors and matrices
  • Sept 8. Introduction to data and visualization
  • Sept 15. Functions
  • Sept 22. Functions 2
  • Sept 29. Simulated evolution 1
  • Oct 6. Check in on HW06 (simulated evolution 2)
  • Oct 13. Simulated evolution 2 due
  • Oct 27. Strings and regular expressions
  • Nov 3. Shaping data and using dplyr
  • Nov 10. Exploring large data sets: US baby names
  • Nov 17. Tidying and reshaping data
  • Dec 1. Your own data project (you have two weeks to complete).

Special accommodation

ADA statement

Any student who, because of a disability, may require special arrangements in order to meet the course requirements should contact the instructor as soon as possible to make any necessary arrangements. Students should present appropriate verification from Student Disability Services during the instructor’s office hours. Please note instructors are not allowed to provide classroom accommodations to a student until appropriate verification from Student Disability Services has been provided. For additional information, you may contact the Student Disability Services office in 335 West Hall or 806-742-2405.

Statement about observance of religious holidays

A student who intends to observe a religious holy day should make that intention known in writing to the instructor prior to the absence. A student who is absent for the observance of a religious holy day shall be allowed to take an exam or complete an assignment scheduled for that day within a reasonable time after the absence.

Illness based absence policy

This course is completely online. However, faculty have been asked to include this section in syllabi. Furthermore, please contact me if you need to miss our synchronous online meetings or if you need flexibility in any assignment due dates.

If at any time during this semester you feel ill, in the interest of your own health and safety as well as the health and safety of your instructors and classmates, you are encouraged not to attend face-to-face class meetings or events. Please review the steps outlined below that you should follow to ensure your absence for illness will be excused. These steps also apply to not participating in synchronous online class meetings if you feel too ill to do so and missing specified assignment due dates in asynchronous online classes because of illness.

  1. If you are ill and think the symptoms might be COVID-19-related: a. Call Student Health Services at 806.743.2848 or your health care provider. b. Self-report as soon as possible using the Office of the Dean of Students website. This website has specific directions about how to upload documentation from a medical provider and what will happen if your illness renders you unable to participate in classes for more than one week. c. If your illness is determined to be COVID-19-related, all remaining documentation and communication will be handled through the Office of the Dean of Students, including notification of your instructors of the period of time you may be absent from and may return to classes. d. If your illness is determined not to be COVID-19-related, please follow steps 2.a–d below.
  2. If you are ill and can attribute your symptoms to something other than COVID-19: a. If your illness renders you unable to attend face-to-face classes, participate in synchronous online classes, or miss specified assignment due dates in asynchronous online classes, you are encouraged to visit with either Student Health Services at 806.743.2848 or your health care provider. Note that Student Health Services and your own and other health care providers may arrange virtual visits. b. During the health provider visit, request a “return to school” note; c. E-mail the instructor a picture of that note; d. Return to class by the next class period after the date indicated on your note. Following the steps outlined above helps to keep your instructors informed about your absences and ensures your absence or missing an assignment due date because of illness will be marked excused. You will still be responsible to complete within a week of returning to class any assignments, quizzes, or exams you miss because of illness.

Academic Honesty

It is the student’s responsibility to conduct him/herself in a civil manner while in the classroom. Please consult the university policy on and academic honesty (OP 34.12) and civility.

Back to top | E-mail Schwilk