You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The header cells surround the data cells.
There are more different headers than you care to hardcode into a script
At long last, there is an example of a consistent schema that breaks (1) and doesn't suffer from (2).
Locate each type of header by filtering, e.g. character == "Species:". Error if not unique (see step 4 for when whole tables repeat, as in the example).
Describe the domain of the header over related data cells by its direction and limit, e.g. direction = "W" and limit = 1 or limit = Inf. Unlike the existing grammar, the direction is from the point of view of the header cell, rather than the data cells.
Given a set of headers so described, unpivotr would resolve the data cells to the matching headers.
If the whole table repeats, as in the example above, the same technique would apply as now -- identify a corner cell of each table, nest, and unpivot one at a time.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: