Diagnosing widening problems

  • Default = error for too many/too few columns
  • "debug" to diagnose
df <- tibble(x = c("1-1-1", "1-3", "1"))
df |> 
  separate_wider_delim(
    x, "-", names = c("x", "y", "z"),
    too_few = "debug"
  )
## Warning: Debug mode activated: adding variables `x_ok`, `x_pieces`, and
## `x_remainder`.
## # A tibble: 3 × 6
##   x     y     z     x_ok  x_pieces x_remainder
##   <chr> <chr> <chr> <lgl>    <int> <chr>      
## 1 1-1-1 1     1     TRUE         3 ""         
## 2 1-3   3     <NA>  FALSE        2 ""         
## 3 1     <NA>  <NA>  FALSE        1 ""