We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
rbind
vec_rbind() works fine, but base::rbind() fails because it relies on the ability to [<- out-of-index in order to grow the vctr.
vec_rbind()
base::rbind()
[<-
Here's a MWE running v0.6.5:
library(tibble) library(vctrs) format.foo <- function(x, ...) { format(vec_data(x)$a) } x <- new_rcrd(list(a = c("foo", "bar"), b = c("baz", "bling")), class="foo") vec_rbind(tibble(x), tibble(x)) #> # A tibble: 4 × 1 #> x #> <foo> #> 1 foo #> 2 bar #> 3 foo #> 4 bar rbind(tibble(x), tibble(x)) #> Error: #> ! Can't assign to elements past the end. #> ℹ Locations 3 and 4 don't exist. #> ℹ There are only 2 elements. #> Backtrace: #> ▆ #> 1. ├─base::rbind(tibble(x), tibble(x)) #> 2. │ └─base::rbind(deparse.level, ...) #> 3. │ ├─base::`[<-`(`*tmp*`, ri, value = `<foo>`) #> 4. │ └─vctrs:::`[<-.vctrs_rcrd`(`*tmp*`, ri, value = `<foo>`) #> 5. │ └─vctrs::vec_assign(vec_data(x), i, vec_data(value)) #> 6. └─vctrs (local) `<fn>`() #> 7. └─vctrs:::stop_subscript_oob(...) #> 8. └─vctrs:::stop_subscript(...) #> 9. └─rlang::abort(...)
Created on 2024-04-08 with reprex v2.0.2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
vec_rbind()
works fine, butbase::rbind()
fails because it relies on the ability to[<-
out-of-index in order to grow the vctr.Here's a MWE running v0.6.5:
Created on 2024-04-08 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: