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

rownames warning when rbinding nested tibbles #898

Closed
llrs opened this issue Jun 22, 2021 · 10 comments
Closed

rownames warning when rbinding nested tibbles #898

llrs opened this issue Jun 22, 2021 · 10 comments

Comments

@llrs
Copy link

llrs commented Jun 22, 2021

A tibble when nested inside another tibble and row bind warns about row names even if no row names are used (version 3.1.2):

library("tibble")
zd <- tibble(a = NA)
z2 <- tibble(place = zd)
z3 <- data.frame(place = zd)
rbind(z2)
#> Warning: Setting row names on a tibble is deprecated.
#> # A tibble: 1 x 1
#>   place$a
#>   <lgl>  
#> 1 NA
rbind(z3)
#>    a
#> 1 NA

Created on 2021-06-23 by the reprex package (v2.0.0)

@krlmlr
Copy link
Member

krlmlr commented Jun 23, 2021

Thanks. Does this also occur with dplyr::bind_rows() ?

@llrs
Copy link
Author

llrs commented Jun 23, 2021

If I use dplyr::bind_rows there isn't any warning.

@krlmlr
Copy link
Member

krlmlr commented Jun 24, 2021

It looks like rbind() is setting row names. Can you please use bind_rows() with tibbles?

@krlmlr krlmlr closed this as completed Jun 24, 2021
@llrs
Copy link
Author

llrs commented Jun 24, 2021

No, I don't want to add another dependency on the package where I found this issue. Thanks for the quick replies.

@krlmlr
Copy link
Member

krlmlr commented Jun 29, 2021

You could also use vctrs::vec_rbind() .

@llrs
Copy link
Author

llrs commented Jun 29, 2021

Yes this works. Maybe this can be added to tibble methods: rbind.tbl_df <- vctrs::vec_rbind?
Anyway, I removed the usage of tibbles to avoid this warning, so my problem is solved.

@hadley
Copy link
Member

hadley commented Jul 11, 2021

It think tibble should do something to avoid this warning, unless it's hugely complicated.

@hadley hadley reopened this Jul 11, 2021
@krlmlr
Copy link
Member

krlmlr commented Jul 29, 2021

#909 implements rbind.tbl_df() for R >= 4.0.0, need to check reverse dependencies before we can merge this.

Closing here as a duplicate of #34.

@krlmlr krlmlr closed this as completed Jul 29, 2021
@llrs
Copy link
Author

llrs commented Jul 29, 2021

Many thanks for adding this. I hope it passes all the reverse dependencies checks and can be shared soon on CRAN.

@github-actions
Copy link
Contributor

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 github-actions bot locked and limited conversation to collaborators Jul 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants