John Mount takes us through a few sample problems and how to reshape data with cdata
:
This may seem like a lot of steps, but it is only because we are taking the problems very slowly. The important point is that we want to minimize additional problem solving when applying the
cdata
methodology. Usually when you need to transform data you are in the middle of some other more important task, so you want to delegate the details of how the layout transform is implemented. Withcdata
the user is not asked to perform additional puzzle solving to guess a sequence of operators that may implement the desired data layout transform. Thecdata
solution pattern is always the same, which can help in mastering it.With
cdata
, record layout transforms are simpleR
objects with detailedprint()
methods- so they are convenient to alter, save, and re-use later. The record layout transform also documents the expected columns and constants of the incoming data.
Check it out.
Comments closed