Skip to content

convert option for separate_wider_* #1513

Open
@paulstillman

Description

@paulstillman

One of the most useful functions of the now superseded separate was the convert = TRUE option that would convert the resulting new columns into, for instance, numeric vectors. So the following:

df <- tibble(a = '1,2,3')
df |> 
  separate(a, into = c('num1', 'num2', 'num3'), sep = ',', convert = TRUE)

outputs as numeric columns:

   num1  num2  num3
  <int> <int> <int>
1     1     2     3

If we do the equivalent separate_wider_delim call:

df |> 
  separate_wider_delim(a, names = c('num1', 'num2', 'num3'), delim = ',')

the output is all character outputs:

  num1  num2  num3 
  <chr> <chr> <chr>
1 1     2     3    

Would it be possible to re-introduce the convert option to separate_wider_delim?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions