-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
featurea feature request or enhancementa feature request or enhancementpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"
Description
When using pivot_wider(), I accidentally created duplicate column names. That was not my intent, but the error message provided made it take a bit more effort to find what the underlying problem was.
It would help if names_repair provided specific error messages indicating what was bad about the names (and possibly how to fix it).
For the toy example below, it would be helpful if the message were something like:
Error: Failed to create output due to bad names: The name "A" is duplicated.
* Choose another strategy with `names_repair`
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
pivot_wider(
data.frame(A=1, B="A", C=3),
names_from="B",
values_from="C"
)
#> Error in pivot_wider(data.frame(A = 1, B = "A", C = 3), names_from = "B", : could not find function "pivot_wider"Created on 2020-06-18 by the reprex package (v0.3.0)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementpivoting ♻️pivot rectangular data to different "shapes"pivot rectangular data to different "shapes"