r-lib / vctrs

Generic programming with typed R vectors

Home Page:https://vctrs.r-lib.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vctrs::vec_locate_matches() error when dplyr::left_join()

lolos0516 opened this issue · comments

commented

Joining with by = join_by(sire_id)
Error in vctrs::vec_locate_matches():
! Match procedure results in an allocation larger than 2^31-1 elements. Attempted allocation size was 3690303424.
ℹ In file match.c at line 2644.
ℹ Install the winch package to get additional debugging info the next time you get this error.
ℹ This is an internal error that was detected in the vctrs package.
Please report it at https://github.com/r-lib/vctrs/issues with a reprex and the full backtrace.
Backtrace:

  1. ├─... %>% drop_na()
  2. ├─tidyr::drop_na(.)
  3. ├─dplyr::left_join(...)
  4. ├─dplyr::distinct(.)
  5. ├─dplyr::left_join(., test)
  6. ├─dplyr:::left_join.data.frame(., test)
  7. │ └─dplyr:::join_mutate(...)
  8. │ └─dplyr:::join_rows(...)
  9. │ └─dplyr:::dplyr_locate_matches(...)
  10. │ ├─base::withCallingHandlers(...)
  11. │ └─vctrs::vec_locate_matches(...)
  12. └─rlang:::stop_internal_c_lib(...)
  13. └─rlang::abort(message, call = call, .internal = TRUE, .frame = frame)

Environment parameters:
R.version:
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 4
minor 3.2
year 2023
month 10
day 31
svn rev 85441
language R
version.string R version 4.3.2 (2023-10-31)
nickname Eye Holes

This problem didn't exist last week. Something changed?

It looks like your resulting table would give 3,690,303,424 rows, which is too large for dplyr to handle. You likely have a missing key in your join_by() statement, so double check that. If you update dplyr to the latest CRAN version, you should actually get a dplyr specific error about this now.