Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

treatment of NULL in rbind.fill doesn't match rbind #138

Closed
ajdamico opened this issue Mar 8, 2013 · 4 comments
Closed

treatment of NULL in rbind.fill doesn't match rbind #138

ajdamico opened this issue Mar 8, 2013 · 4 comments

Comments

@ajdamico
Copy link

ajdamico commented Mar 8, 2013

not sure if this is intentional, possible improvement to rbind.fill()

library(plyr)

# works
rbind( NULL , mtcars )

# works
rbind.fill( data.frame() , mtcars )

# breaks
rbind.fill( NULL , mtcars )
@otsaw
Copy link

otsaw commented May 17, 2013

This used to work at least in 1.7.1.

It seems that the fix to issue #51 is at fault.

@hadley
Copy link
Owner

hadley commented Jan 2, 2014

Do you have a real use case where this causes a problem?

@otsaw
Copy link

otsaw commented Jan 3, 2014

Yes, I'd say so. Something like

dfs = lapply(...)
df = do.call(rbind.fill, dfs)

Depending on what the function under lapply does and what kinds of data it happens to have it's fully possible to get a NULL value instead of a zero-length data frame. And since at least unlist and rbind gracefully discard NULLs, I'm not used to trying to avoid them.

@hadley hadley closed this as completed in bd8cba3 Jan 3, 2014
@hadley
Copy link
Owner

hadley commented Jan 3, 2014

Makes sense - now fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants