There's more...

The unnest() function will only work when the nested list column members are compatible and can be sensibly aligned and recycled according to the normal rules. In many cases, this won't be true so you will need to manually manipulate the output. The following example shows how we can do that. The workflow is essentially the same as the preceding example, though one change early on is that we use dplyr::group_by() to create the groups for nest(). In mutate(), we pass a custom function to analyze the data, but, otherwise, this step is the same. The last step is the biggest change and takes advantage of transmute() to drop the unneeded columns and create a new column that is the result of map_dbl() and a custom summary function. map_dbl() is like map() but returns only double numeric vectors. Other map_** functions also exist.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.174.133