Convenience method for join+insertion operation #4080
Labels
duplicate
feature request
joins
Use label:"non-equi joins" for rolling, overlapping, and non-equi joins
programming
parameterizing queries: get, mget, eval, env
My workflow involves a lot of the following: I have two tables, A & B, and I want to insert some of A's columns into B via a join. So, something like
B[A, `:=`(col1 = i.col1, col2 = i.col2, ....), on = c("x", "y")]
A few annoyances led me to write the helper function below
B[A, eval(parse(text = insertStr)), on = c("x", "y")]
So, I made the following convenience/helper function for myself
I find it extremely useful as it saves me a lot of time and makes my code cleaner. Allow me to demonstrate.
I know this function has much room for improvement, but I wanted to share in case others found it useful and would like it to become a part of data.table. ..or maybe this functionality already exists and somehow I missed it.
Thanks
The text was updated successfully, but these errors were encountered: