r-lib / vctrs

Generic programming with typed R vectors
https://vctrs.r-lib.org
Other
287 stars 66 forks source link

problems with vctrs/dplyr packages in R #1907

Closed yairamitai closed 7 months ago

yairamitai commented 9 months ago

Hi, I'm trying to reshape my data from wide to long. I am using the reshape command mainly because I have more than one column in the new data that should be long. I'm getting the following error:

Backtrace: ▆

  1. ├─stats::reshape(...)
  2. │ └─stats (local) reshapeLong(...)
  3. │ ├─base::do.call(...)
  4. │ └─base (local) <fn>(...)
  5. │ └─dplyr (local) rbind(deparse.level, ...)
  6. │ └─dplyr::bind_rows(...)
  7. │ └─vctrs::vec_rbind(!!!dots, .names_to = .id, .error_call = current_env())
  8. │ └─vctrs (local) <fn>()
  9. │ └─vctrs (local) vec_cast.grouped_df.grouped_df(...)
    1. │ └─vctrs:::gdf_cast(x, to, ...)
    2. │ └─dplyr::grouped_df(df, vars, drop = drop)
    3. │ └─dplyr:::compute_groups(data, vars, drop = drop)
    4. │ └─dplyr:::dplyr_locate_sorted_groups(group_vars)
    5. │ └─vctrs::vec_locate_sorted_groups(x, nan_distinct = TRUE)
    6. └─rlang:::stop_internal_c_lib(...)
    7. └─rlang::abort(message, call = call, .internal = TRUE, .frame = frame)

When I tried to write a reprex for my data, the command actually worked. Even when I reinstall the packages "vctrs" and "dplyr," the command works again, but other commands like drop_na suddenly don't. I'm quite confused. I would appreciate some help!

DavisVaughan commented 9 months ago

Unfortunately it is quite hard for us to guess at the problem without a reprex 😢