Open nacnudus opened 4 years ago
Do we know if there are any other datasets with this structure or if it's an evil one-off? I've never seen a structure like this before.
That's a reasonable point, although it isn't how nerd-sniping works :smile:
I often get this sort of semi-structured format when working spreadsheets / text files generated by exporting pivoted tables from pdf. i'm eager to test the readr::melt functionality for dealing with it on my next project that can afford to pay me for some development time.
The current unpivotr grammar starts from the point of view of data cells, and searches for associated headers. This imitated databaker, because it is useful in the most common case (in my experience).
At long last, there is an example of a consistent schema that breaks (1) and doesn't suffer from (2).
Untidy data
Tidy version
Thoughts
character == "Species:"
. Error if not unique (see step 4 for when whole tables repeat, as in the example).direction = "W"
andlimit = 1
orlimit = Inf
. Unlike the existing grammar, the direction is from the point of view of the header cell, rather than the data cells.