Importing Data into R
Author(s): Rachel Hartnett
Oklahoma State University
1575 total view(s), 964 download(s)
- Importing_Data.swc(SWC | 15 KB)
- Lesson plan and implementation notes_Hartnett_importing data.pdf(PDF | 79 KB)
- rsos_niches.csv(CSV | 705 B )
- Walk through of making a table for R.pptx(PPTX | 176 KB)
- Importing data
- License terms
Description
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!
Notes
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.
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