-
Notifications
You must be signed in to change notification settings - Fork 131
Add a cbind method for tbl_df? #85
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
Comments
I've checked |
97a0e10 contains a draft, but especially the cases when binding a data frame to a non-data frame are tricky. There's |
Related: #34 for rbind(). |
I second this issue. My use case is this:
I need to work with list columns, so I want to use tibbles to sidestep some problems. It's a bit annoying if they keep getting implicitly converted back to regular data frames. I took a stab at it. This is probably a terrible way to do, and maybe buggy for other use cases. I left in my mistakes and attempts in case they are useful to someone else.
Test:
So we get the right output. |
Unfortunately, a cbind method seems to require patching the base R function, like data.table does. Please use |
Can't Does that need a separate issue (perhaps one that I have overlooked)? |
We should do this eventually, but this also seems to require moving considerable parts of the C++ code, especially for |
Would this make more sense now, given that the vctrising of tibble/dplyr means that (I ran into this issue today in a small package I'm developing) Cheers! |
@jeffreypullin If it helps, there is now |
Hi Jenny thanks for that - looks very useful. Apologies for not noticing it in the docs. |
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. |
I recently needed to do the equivalent of
cbind(foo = 1:3, bar)
wherebar
was atbl_df
, where I wantedfoo
to end up as the first column/variable in the resultingtbl_df
.The dplyr solutions suggested to me involved
mutate()
+select(..., everything())
orbind_cols()
, which seems to void a reason for pulling the tibbles out of that package into this one.Having this would be a nice usability boon for the pkg.
The text was updated successfully, but these errors were encountered: