non-equi-joins in R with data.table - backticked column name trouble

后端 未结 1 698
失恋的感觉
失恋的感觉 2020-12-11 11:02

I can\'t manage to do a non-equi-join with data.table when (backticked) column names include a space.

I collect such names from our database at work, and our explici

相关标签:
1条回答
  • 2020-12-11 11:22

    Specifying on= with strings is another option:

    a[b, on = c("test name1==test name4", "test name2>test name3", "test name2<=V2")]
    

    I think this works only if there is no whitespace around the equality/inequality operators and == is used instead of =.

    I'm not sure if there's a way to write the on= along the lines of the OP's code, though it seems like there should be.

    0 讨论(0)
提交回复
热议问题