Perform a join operation between two dataframes. Use sd_join_by() to specify join conditions using x$column and y$column syntax to reference columns from the left and right tables respectively.

sd_join(
  x,
  y,
  by = NULL,
  join_type = "inner",
  select = sd_join_select_default(),
  keep = NULL
)

sd_left_join(x, y, by = NULL, select = sd_join_select_default(), keep = NULL)

sd_right_join(x, y, by = NULL, select = sd_join_select_default(), keep = NULL)

sd_inner_join(x, y, by = NULL, select = sd_join_select_default(), keep = NULL)

sd_full_join(x, y, by = NULL, select = sd_join_select_default(), keep = NULL)

sd_semi_join(x, y, by = NULL)

sd_anti_join(x, y, by = NULL)

sd_cross_join(x, y, select = sd_join_select_default())

Arguments

x

The left dataframe

y

The right dataframe

by

Join specification. One of:

join_type

The type of join to perform. One of "inner", "left", "right", "full", "leftsemi", "rightsemi", "leftanti", "rightanti", "leftmark", or "rightmark".

select

Post-join column selection. One of

  • NULL for no modification, which may result in duplicate (unqualified) column names. The column may still be referred to with a qualifier in advanced usage using sd_expr_column().

  • sd_join_select_default() for dplyr-like behaviour (equi-join keys or spatial join keys removed for inner/left joins, intersecting names suffixed)

  • sd_join_select() for a custom selection

keep

Use TRUE to keep all key columns in an equijoin or spatial join. This is only applied when using sd_join_select_default() for left/inner joins and right equijoins (full joins and right spatial joins always keep spatial join keys).

Value

An object of class sedonadb_dataframe

Examples

df1 <- data.frame(x = letters[1:10], y = 1:10)
df2 <- data.frame(y = 10:1, z = LETTERS[1:10])
df1 |> sd_join(df2)
#> Joining with `by = sd_join_by(y)`
#> <sedonab_dataframe: ?? x 3>
#> ┌──────┬───────┬──────┐
#> │   x  ┆   y   ┆   z  │
#> │ utf8 ┆ int32 ┆ utf8 │
#> ╞══════╪═══════╪══════╡
#> │ j    ┆    10 ┆ A    │
#> ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
#> │ i    ┆     9 ┆ B    │
#> ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
#> │ h    ┆     8 ┆ C    │
#> ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
#> │ g    ┆     7 ┆ D    │
#> ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
#> │ f    ┆     6 ┆ E    │
#> ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
#> │ e    ┆     5 ┆ F    │
#> └──────┴───────┴──────┘
#> Preview of up to 6 row(s)