-
Notifications
You must be signed in to change notification settings - Fork 129
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
Use num_as_location(oob = "extend") internally #746
Comments
I think so. I implemented this for tibble :) |
Do we want to support the Would it be too bad if |
Can you show an example please?
This isn't possible because we preserve the names of the subscript vector. |
Works alreadyi <- c(1, 2, 4, 3)
i <- rlang::set_names(i, letters[i])
i
#> a b d c
#> 1 2 4 3
vctrs::num_as_location(i, 3, oob = "extend")
#> a b d c
#> 1 2 4 3 Desired behaviori <- c(1, 2, 4, 3)
i <- rlang::set_names(letters[i])
i
#> a b d c
#> "a" "b" "d" "c"
vctrs::vec_as_location(i, 3, letters[1:3], oob = "extend")
#> a b d c
#> 1 2 4 3 Created on 2020-03-26 by the reprex package (v0.3.0) |
Requires r-lib/vctrs#1166. |
- Use `vctrs::num_as_location()` internally for subset assignment of rows and columns for better error messages (#746).
tibble 3.0.4 - Establish compatibility with upcoming pillar 1.5.0 (#818). - `tbl_sum()` shows "data frame" instead of "tibble" for objects inheriting from `"tbl"` but not `"tbl_df"` (#818). - Export `format.tbl()` and `print.tbl()` only if pillar doesn't (#816). - Use `vctrs::num_as_location()` internally for subset assignment of rows and columns for better error messages (#746). - Adapt tests to the development version of testthat. - Fix documentation link to `base::Extract`. - `add_row(df)` adds an empty row again (#809, @DavisVaughan).
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. |
for subassignment.
@lionel-: Is this a good idea for tibble 3.0.0?
The text was updated successfully, but these errors were encountered: