Split.train.test got a Join columns must be unique error in win 10 but working at win 7

Hi guys,

I'm new to R for like a month, so still in the learning phase.

I got a piece of code that is working at win 7, and we tested and ran the code smoothly last week. But that computer has already been updated to win 10 this week, and unfortunately, I have to rerun the code on win 10.

So here is what I got, when I ran:

> idx_fraud_train <- fraud_latest %>% Split.train.test(train_proportion, group_var="idx_UAN", stratify_var="FRAUD_TYPE", category_var="IS_CUSTOMER", by_category="NO")

and the result is:

`summarise()` ungrouping output (override with `.groups` argument)
 Error: Join columns must be unique.
x Problem at position 2.
Run `rlang::last_error()` to see where the error occurred. 

> rlang::last_error()
<error/rlang_error>
Join columns must be unique.
x Problem at position 2.
Backtrace:
  9. global::Split.train.test(...)
 10. dplyr::left_join(., y = groups, by = c("GROUP_VAR", "GROUP_VAR"))
 20. dplyr:::join_mutate(...)
 21. dplyr:::join_cols(...)
 22. dplyr:::standardise_join_by(by, x_names = x_names, y_names = y_names)
 23. dplyr:::check_join_vars(by$x, x_names)
Run `rlang::last_trace()` to see the full context.

> rlang::last_trace()
<error/rlang_error>
Join columns must be unique.
x Problem at position 2.
Backtrace:
     x
  1. \-`%>%`(...)
  2.   +-base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3.   \-base::eval(quote(`_fseq`(`_lhs`)), env, env)
  4.     \-base::eval(quote(`_fseq`(`_lhs`)), env, env)
  5.       \-`_fseq`(`_lhs`)
  6.         \-magrittr::freduce(value, `_function_list`)
  7.           +-base::withVisible(function_list[[k]](value))
  8.           \-function_list[[k]](value)
  9.             \-global::Split.train.test(...)
 10.               \-temp_data %>% left_join(y = groups, by = c("GROUP_VAR", "GROUP_VAR")) 00 functions and libraries v2.4.R:114:2
 11.                 +-base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
 12.                 \-base::eval(quote(`_fseq`(`_lhs`)), env, env)
 13.                   \-base::eval(quote(`_fseq`(`_lhs`)), env, env)
 14.                     \-`_fseq`(`_lhs`)
 15.                       \-magrittr::freduce(value, `_function_list`)
 16.                         +-base::withVisible(function_list[[k]](value))
 17.                         \-function_list[[k]](value)
 18.                           +-dplyr::left_join(., y = groups, by = c("GROUP_VAR", "GROUP_VAR"))
 19.                           \-dplyr:::left_join.data.frame(...)
 20.                             \-dplyr:::join_mutate(...)
 21.                               \-dplyr:::join_cols(...)
 22.                                 \-dplyr:::standardise_join_by(by, x_names = x_names, y_names = y_names)
 23.                                   \-dplyr:::check_join_vars(by$x, x_names)

Sorry, I'm really confusing at the moment, could anyone help in solving this issue? Thanks!

My guess would be that when switching to Win 10, you also installed the latest version of R and dplyr, whereas the Win 7 installation might not have been fully up to date, and that a specific operation in your code is no longer possible.

So it will help to provide a reprex, in particular providing (part of) the code of Split.train.test() and what fraud_latest looks like.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.