Wide-to-tall Data Reshaping Using Regular Expressions and the nc Package
Toby Dylan Hocking
, The R Journal (2021) 13:1, pages 69-82.
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).
Received: 2020-04-30; online 2021-06-07, supplementary material, (136.9 KiB)@article{RJ-2021-029, author = {Toby Dylan Hocking}, title = {{Wide-to-tall Data Reshaping Using Regular Expressions and the nc Package}}, year = {2021}, journal = {{The R Journal}}, doi = {10.32614/RJ-2021-029}, url = {https://doi.org/10.32614/RJ-2021-029}, pages = {69--82}, volume = {13}, number = {1} }