TidierOrg / Tidier.jl

Meta-package for data analysis in Julia, modeled after the R tidyverse.
MIT License
524 stars 14 forks source link

Implementing join macros #11

Closed kdpsingh closed 1 year ago

kdpsingh commented 1 year ago

In R, joins (e.g., left_join) auto-detect matching columns, although you can optionally indicate what to join on, and you can also specify if the column names that needed to be joined on have different names.

In the first pass, I would like to implement this capability in a series of macros, where of the following is valid:

@left_join(df1, df2) # columns to join on are inferred based on matching names

@left_join(df1, df2, by = id) # match on id column

@left_join(df1, df2, by = join_by(id)) # match on id column

@left_join(df1, df2, by = join_by(id1 == id2)) # match id1 in df1 to id2 in df2

These last 2 examples are based on the new join_by syntax in the newest dplyr, with the eventual hope that we will support non-equijoins using this similar syntax.

kdpsingh commented 1 year ago

Resolved by PR #30.