Statistics, Department of

 

The R Journal

Date of this Version

6-2021

Document Type

Article

Citation

The R Journal (June 2021) 13(1); Editor: Dianne Cook

Comments

Copyright 2021, The R Foundation. Open access material. License: CC BY 4.0 International

Abstract

Regular expressions are powerful tools for extracting tables from non-tabular text data. Capturing regular expressions that describe the information to extract from column names can be especially useful when reshaping a data table from wide (few rows with many regularly named columns) to tall (fewer columns with more rows). We present the R package nc (short for named capture), which provides functions for wide-to-tall data reshaping using regular expressions. We describe the main new ideas of nc, and provide detailed comparisons with related R packages (stats, utils, data.table, tidyr, tidyfast, tidyfst, reshape2, cdata).

Share

COinS