Wrangling Categorical Data in R

1Citations
Citations of this article
161Readers
Mendeley users who have this article in their library.
Get full text

Abstract

Data wrangling is a critical foundation of data science, and wrangling of categorical data is an important component of this process. However, categorical data can introduce unique issues in data wrangling, particularly in real-world settings with collaborators and periodically-updated dynamic data. This article discusses common problems arising from categorical variable transformations in R, demonstrates the use of factors, and suggests approaches to address data wrangling challenges. For each problem, we present at least two strategies for management, one in base R and the other from the “tidyverse.” We consider several motivating examples, suggest defensive coding strategies, and outline principles for data wrangling to help ensure data quality and sound analysis. Supplementary materials for this article are available online.

Cite

CITATION STYLE

APA

McNamara, A., & Horton, N. J. (2018). Wrangling Categorical Data in R. American Statistician, 72(1), 97–104. https://doi.org/10.1080/00031305.2017.1356375

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free