You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using tidyr::unite on a list of dataframes I came across the following error. I'm only reporting it because it asked me to!
The list of dataframes was messy, so I was looking for a way of combining columns that may or may not exist. I'd be happy for unite to throw a warning, or error, to tell me that there were no input columns selected.
tidyr::unite(mtcars, "hello", contains("missing_column"))
#> Error in `df_append()`:#> ! `after` must be a whole number, not an integer `NA`.#> ℹ This is an internal error that was detected in the tidyr package.#> Please report it at <https://github.com/tidyverse/tidyr/issues> with a reprex#> (<https://tidyverse.org/help/>) and the full backtrace.#> Backtrace:#> ▆#> 1. ├─tidyr::unite(mtcars, "hello", contains("missing_column"))#> 2. └─tidyr:::unite.data.frame(mtcars, "hello", contains("missing_column"))#> 3. └─tidyr:::df_append(after = after)#> 4. └─tidyr:::check_number_whole(after, min = 0L, max = n, .internal = TRUE)#> 5. └─tidyr:::.rlang_types_check_number(...)#> 6. └─tidyr (local) .stop(x, what, ...)#> 7. └─tidyr:::stop_input_type(...)#> 8. └─rlang::abort(message, ..., call = call, arg = arg)
Same error here. I came because the error told me to do so.
library(tidyverse)
df<- tibble(
a_1=3,
a_2=4
)
df|>
unite(b, starts_with("b"))
#> Error in `df_append()`:#> ! `after` must be a whole number, not an integer `NA`.#> ℹ This is an internal error that was detected in the tidyr package.#> Please report it at <https://github.com/tidyverse/tidyr/issues> with a reprex#> (<https://tidyverse.org/help/>) and the full backtrace.#> Backtrace:#> ▆#> 1. ├─tidyr::unite(df, b, starts_with("b"))#> 2. └─tidyr:::unite.data.frame(df, b, starts_with("b"))#> 3. └─tidyr:::df_append(after = after)#> 4. └─tidyr:::check_number_whole(after, min = 0L, max = n, .internal = TRUE)#> 5. └─tidyr:::.rlang_types_check_number(...)#> 6. └─tidyr (local) .stop(x, what, ...)#> 7. └─tidyr:::stop_input_type(...)#> 8. └─rlang::abort(message, ..., call = call, arg = arg)
While using
tidyr::unite
on a list of dataframes I came across the following error. I'm only reporting it because it asked me to!The list of dataframes was messy, so I was looking for a way of combining columns that may or may not exist. I'd be happy for unite to throw a warning, or error, to tell me that there were no input columns selected.
Created on 2023-08-31 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: