Skip to content

Unify argument flexibility of both single value and named list of values #1284

@DavisVaughan

Description

@DavisVaughan
  • Also remove NEWS bullet about moving towards ptype = list()

unchop()

  • ptype = list()
    • Change to ptype = NULL (original behavior)
    • Use is_ptype() and wrap into a named list with names of cols if TRUE
    • Useful when you only specify 1 column to unchop, which is most of the time

unnest()

  • ptype = list()
    • Inherits unchop behavior
    • Change to ptype = NULL (original behavior)

pivot_longer()

  • values_ptypes = list() and names_ptypes = list()

    • Change to = NULL
    • Use is_ptype() and wrap into a named list with names of names_from or values_from
  • values_transform = list() and names_transform = list()

    • Change to = NULL
    • Wrap if not a list, then map over list with as_function()

unnest_longer() / unnest_wider() / hoist()

  • ptype = list()

  • transform = list()


Already done, or not touching

pivot_wider()

  • values_fill = NULL

    • Allows scalar value
    • Allows named list of scalar values
  • values_fn = NULL / unused_fn = NULL

    • Allows single function
    • Allows named list of functions

replace_na() / complete()

  • fill = list()
    • Not updating this one. This controls both the overall selection AND the replacement value. Allowing fill = 0 would fill all columns in the data frame with 0 where there were missing values, which means all columns had to be the same type, which is rare.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions