Using nested dataframes for functional programming
Functional programming is a programming style that focuses on using functions to solve problems. It avoids changing data and emphasizes writing clear, reusable code that is easier to understand and predictable in its behavior.
The dataframe is at the core of the tidy way of working, and we tend to think of it as a spreadsheet-like rectangular data container, with only a single value in each cell. In fact, dataframes can be nested – they can hold other dataframes in specific single cells. This is achieved internally by replacing a dataframe’s vector column with a list column so that each cell becomes a member of a list, and any sort of object can be held within the now conceptual single cell of the outer dataframe.
In this recipe, we’ll look at ways to make a nested dataframe and ways of working with it using a functional style, with the aim that it will simplify working with large or multifaceted data.
...