tibble icon indicating copy to clipboard operation
tibble copied to clipboard

Provide rbind method

Open hadley opened this issue 8 years ago • 18 comments

That uses dplyr::bind_rows().

Moved from https://github.com/hadley/dplyr/issues/1385

hadley avatar Mar 07 '16 15:03 hadley

Does this mean copying the bind_rows() implementation from dplyr? This seems to need at least Collecter, SlicingIndex and set_rownames().

krlmlr avatar Mar 07 '16 16:03 krlmlr

Yeah, I'm not sure how to deal with that. One option would be to add a dplyr dependency to tibble (just a suggest), but that seems suboptimal.

hadley avatar Mar 07 '16 19:03 hadley

I think I'll add rbind.tbl_df() and make sure it behaves like the dplyr equivalent.

krlmlr avatar Mar 07 '16 22:03 krlmlr

I think we can leave this for now.

hadley avatar Mar 18 '16 14:03 hadley

Can this be reconsidered/reopened? Part of the justification for tibble is so you don't need all of dplyr just to have the data frame goodness. As such tibble should provide a suite of tools for working with tibbles or tbl_dfs.

An rbind.tbl_df() would be a most useful addition to this package

gavinsimpson avatar May 27 '16 21:05 gavinsimpson

Not in near future - there is a lot of code powering bind rows that we'd need to duplicate. All the variable coercion stuff is complicated.

hadley avatar May 27 '16 21:05 hadley

Is it being considered for the longer term future? Closing this issue gave me the impression this wasn't something you were going to deal with.

I have no doubt this is complicated; if it were easy I suspect it would have been done by now.

gavinsimpson avatar May 27 '16 22:05 gavinsimpson

In the long long term I'd like to move data frame stuff related here but it's probably at least a year away

hadley avatar May 27 '16 22:05 hadley

I think we could do just what data.table does -- they're patching rbind.data.frame(): https://github.com/hadley/dplyr/issues/606#issuecomment-56529411.

krlmlr avatar Jan 26 '17 10:01 krlmlr

Did we agree to not patch fix rbind() and cbind()?

krlmlr avatar Apr 17 '17 20:04 krlmlr

I'd prefer not to mess with base R functions

hadley avatar Apr 17 '17 20:04 hadley

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

github-actions[bot] avatar Dec 13 '20 00:12 github-actions[bot]

Let's retry, also with cbind(), now that we have vctrs.

krlmlr avatar Jul 18 '21 13:07 krlmlr

:+1:

hadley avatar Jul 18 '21 18:07 hadley

Things appear to have changed for R 4.0.0, the relevant FAQ in data.table was updated. Are we ok with a solution that works only in R 4.0.0 now, should we postpone until the tidyverse requires R 4.0.0?

krlmlr avatar Jul 20 '21 15:07 krlmlr

I think it's fine to add a solution that only works in 4.0.0 and up. That will help the majority of users.

hadley avatar Jul 20 '21 18:07 hadley

Done. I'll release to CRAN without it, we might want to do revdepchecks because users might rely on downcasting to data frames.

krlmlr avatar Jul 21 '21 04:07 krlmlr

Do we still want this, given the complexities discussed in #909?

@DavisVaughan suggests to

link to vec_rbind() in the tibble::add_row() documentation. i.e. "If you would like to row bind multiple data frames together, see..."

Similar for vec_cbind() and tibble::add_column().

krlmlr avatar Oct 25 '21 03:10 krlmlr