Good question! It took me a while to wrap my head around the possibilities of nest()
/unnest()
, too (and list-columns in general). There are a good number of examples floating around this site, but sadly they're not easily browsable as such. Here, in no particular order, are a few I dug up from my hazy memory (so obviously totally biased towards threads I've posted in ):
- Adding nested observations to a dataframe
- Coalesce rows and remove NAs but keep all non-NA rows for each unique group
- Tidying a one column dataframe by groups in the data
- Assign range of dates for each unique row in the dataframe.
- JSON parsing and nested lists
Another fantastic Jenny Bryan resource that touches on nesting: