This short swirl lesson on importing data is designed to 1) get a basic understanding in how tables are read into R and some common issues and 2) develop an individual set of instructions for students to use later to import a table on their own.
Listed in Teaching Materials | resource by group Make Teaching with R in Undergraduate Biology Less Excruciating
The focus of this swirl lesson is to provide scaffolding to help students learn to import data into R from a .csv file. The lesson includes a dataset modified from the Dryad Digital Repository (https://doi.org/10.5061/dryad.6jr5797). Students are required to format the provided .csv file and import the edited file into R by following the lesson. The assessment for this lesson asks for an annotated R script that would allow anyone to upload the table into R studio. This lesson is designed to be completed under an hour (the majority of students took ~20-35 minutes during an implementation of a previous version of this lesson). Modifications and/or additions that include several different issues involved in correctly formatting a data table would be welcome!
Cite this work
Researchers should cite this work as follows:
- Hartnett, R. (2019). Importing Data into R. Make Teaching with R in Undergraduate Biology Less Excruciating, QUBES Educational Resources. doi:10.25334/Q4W161
A previous version of this lesson (unpublished) was implemented in the classroom using the table from http://www.intro2r.info/unit2/importing-data.html. The main implementation issue for students was not knowing how to change the format of cells in Excel from 'Currency' to 'General'. An overview of basic excel skills was not provided, but would be encouraged before this lesson. The current version of the lesson uses a modified dataset from data dryad (https://doi.org/10.5061/dryad.6jr5797). This final lesson was not implemented in the classroom, but the issues of formatting were seen as a bigger issue for my students in a separate activity where students were required to make their own table in excel to import (the a further assessment step in the course). The powerpoint attached was enough information to guide students to the correct formatting practices. See implementation notes for more details.
Make Teaching with R in Undergraduate Biology Less Excruciating
This publication belongs to the Make Teaching with R in Undergraduate Biology Less Excruciating group.
When watching a resource, you will be notified when a new version is released.