unnest_wider
unstable with respect to row order when elements have duplicated names
#1501
Labels
bug
an unexpected problem or unintended behavior
I've encountered what seems to be a bug in unnest_wider.
Consider the following setup: You have a tibble where one of the columns contains a nested list, the elements of which may include duplicate names repeated a variable number of times across observations (as in a nested XML document).
If the "larger" observation (in the sense of having maximum number of repeated-and-duplicatively-named list elements across all observations) is the first observation, unnest_wider with names_sep and names_repair handles the flattening the way it should.
However, if the "smaller" observation occurs first, unnest_wider drops the all but the first instance of the repeated-and-duplicate-named list element, hence deleting information should be flattened into additional distinct columns.
See below for a simple example.
Brief description of the problem
The text was updated successfully, but these errors were encountered: