Skip to main content

Reformatting Tables: tidyr

  • Chapter
  • First Online:
R Data Science Quick Reference

Abstract

Even if we only consider tabular data, there are still many different ways to format this data. The packages in the Tidyverse expect that data is represented as so-called “tidy data” (which is where the name Tidyverse comes from). The tidyr package helps you with formatting your data into tidy data.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://en.wikipedia.org/wiki/Tidy_data

  2. 2.

    The gather() and spread() functions transform tibbles in opposite directions in the sense that I have described here, but they are not truly each other’s reverse. The types of values can change depending on the convert argument to gather(), and the order of rows can change.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Thomas Mailund

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Mailund, T. (2019). Reformatting Tables: tidyr. In: R Data Science Quick Reference. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4894-2_4

Download citation

Publish with us

Policies and ethics