Loading and Cleaning Small Datasets in R

08–A: Learning Outcomes

In this module, we will be learning how to:

    1. Download a dataset from Qualtrics and open our dataset in Excel.

    2. Delete columns that we do not need to make our dataset more management to work with.

    3. Rename column headings to make sense to us.

    4. Spot missing data in a dataset and think about how to handle that missing data.

    5. Compile variables into a single outcome variable for running analyses.

If you want to view the Qualtrics survey that we collected the example data from, you may view the survey here:

https://umdsurvey.umd.edu/jfe/form/SV_a5XHsNPL2U7oZ1A

Please download the example data here:

https://drive.google.com/file/d/13v4FsUCWkqQmrepiJEpzgvuvgcOC4S_x/view?usp=sharing

Video (0:36)

08–B: Downloading a Dataset in Qualtrics and Opening in Excel

UMD students should navigate to: umdsurvey.umd.edu

Non-UMD affiliates may be able to access Qualtrics through their own institution or may export their excel dataset from any other data collecting source.


Video (3:32)

08–C: Deleting Unnecessary Columns

Video (1:47)

08D: Renaming Columns

Video (3:11)

08E: Handling Missing Data

Video (2:21)

08F: Creating A Single Outcome Variable

Video (4:32)

Now we're ready to move our excel file into R! Groovy!

Image by Allison Horst @allison_horst

References

  1. Chapter image made using with Canva ©2021 https://www.canva.com/

  2. Horst, A. R for Excel Users. https://www.allisonhorst.com/post/r-for-excel/ License CC-BY-SA 4.0

  3. Microsoft Microsoft Corporation. (2018). Microsoft Excel. Retrieved from https://office.microsoft.com/excel

  4. The data for this example was generated using Qualtrics software, Version XM of Qualtrics. Copyright © 2021 Qualtrics. Qualtrics and all other Qualtrics product or service names are registered trademarks or trademarks of Qualtrics, Provo, UT, USA. https://www.qualtrics.com and provided by Emily Forgo.

Interested in Learning More?

  1. https://cran.r-project.org/doc/contrib/de_Jonge+van_der_Loo-Introduction_to_data_cleaning_with_R.pdf

This publication goes into detail about cleaning data in R

  1. https://rfortherestofus.com/2019/12/how-to-clean-messy-data-in-r/

This website includes packages from tidyverse used to clean data in R if you are interested

  1. For more information about Qualtrics datasets: https://www.qualtrics.com/support/survey-platform/data-and-analysis-module/data/download-data/understanding-your-dataset/

  2. More R instructional notes: https://www.statology.org/r-guides/ © 2021 Statology