Coder Social home page Coder Social logo

Comments (3)

hadley avatar hadley commented on August 17, 2024

Could you please provide a reproducible example?

from tidyr.

adder avatar adder commented on August 17, 2024

off course.
I would expect that this code:

library(dplyr)
library(tidyr)
dat1 = data_frame(a = 1:3, b = 4:6)
dat2 = data_frame(c = 7:9,d = list(dat1,dat1,dat1))
unnest(dat2, d)

gives this output:

c a b
7 1 4
7 2 5
7 3 6
8 1 4
8 2 5
8 3 6
9 1 4
9 2 5
9 3 6

You would need to make the assumption that all the dataframes in the list variable are the same. A typical use case could be that on some variables in a dataframe a function is applied rowwise that gives back a dataframe. Then one would want to unnest this for easy data manipulations where also the information in the nested data frames is needed (for grouping, filtering,...)

I hope this is clear enough.

from tidyr.

hadley avatar hadley commented on August 17, 2024

Thanks, that definitely should work. I'll take a look next time I'm working on tidyr

from tidyr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.