Using unstack and pivot to reshape data from long to wide
Sometimes, we actually have to move data from a tidy to an untidy structure. This is often because we need to prepare the data for analysis with software packages that do not handle relational data well, or because we are submitting data to some external authority that has requested it in an untidy format.
pivot can be helpful when we need to reshape data from long to wide format.
unstack does the opposite of what we did with
pivot does the opposite of
We continue to work with the NLS data on weeks worked and college enrollment in this recipe.