← Back to all sparks
T

tidyr

ANALYTICS
Velocity0.0

Tools for creating tidy data in R

tidyr replaced separate() with a family that says what it does.

tidyversedata-reshapingpivotingapi-designr-language
Current state
tidyr is at 1.3.2, a collection of argument additions — fill() gains .by, expand_grid() gains .vary — and better error messages around unchop() and pivot_wider_spec(). The structural work is 1.3.0, which introduced separate_wider_delim(), separate_wider_position(), separate_wider_regex(), separate_longer_delim() and separate_longer_position() as thorough replacements for separate(), extract() and separate_rows().
Where it's heading
Two habits define this window. Verbs are being split into explicitly named variants rather than overloaded with arguments, which is what the separate_* family does to separate(). And .by is spreading as the standard way to express grouping inline — nest(.by=) in 1.3.0, fill(.by=) in 1.3.2 — pulling users away from wrapping calls in group_by().
Prediction
Given that .by has now reached fill() and nest(), the next release most likely extends the same argument to further verbs rather than reworking another function family.

Recent moves

  1. 7mo ago

    fill() gains .by; expand_grid() gains .vary

    fill() gains .by for inline grouping and expand_grid() gains .vary to control which column varies fastest. Several error messages improve and unite() now returns an empty-string column instead of erroring on an empty selection.

    View source ↗
  2. 2y ago

    pivot_wider duplicate message uses modern syntax

    A single change modernising the syntax in pivot_wider's duplicate-detection helper message. Cosmetic.

    View source ↗
  3. 3y ago

    separate_wider_* family supersedes separate() and extract()

    Introduces the separate_wider_* and separate_longer_* family, superseding separate(), extract() and separate_rows() with faster, more consistent functions and a defined approach to malformed input. nest() gains .by, and pivot_longer() gains cols_vary.

    View source ↗
  4. 3y ago

    Hot patch for R CMD check failures

    A hot patch for R CMD check failures, with no other content.

    View source ↗
  5. 4y ago

    pivot_wider() gains names_expand, id_expand and unused_fn

    pivot_wider() gains names_expand and id_expand for making implicit missing combinations explicit, names_vary for column ordering, and unused_fn for summarising columns left out of the pivot. Note the stored body is cut at 8000 characters, so later items in this changelog are not visible here.

    View source ↗
  6. 4y ago

    Large speedups to unchop(), unnest() and expand_grid()

    Performance work with wide reach: unchop() gets much faster and that propagates through unnest(), unnest_longer(), unnest_wider() and separate_rows(), while expand_grid() roughly doubles in speed. Mixing vectors and data frames in an unnested list-column now errors.

    View source ↗