sd_join.RdPerform 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())The left dataframe
The right dataframe
Join specification. One of:
A sedonadb_join_by object from sd_join_by()
A sedonadb_join_by object from sd_join_intersects(),
sd_join_contains(), sd_join_within(), sd_join_covers(),
sd_join_coveredby(), sd_join_touches(), sd_join_crosses(),
sd_join_overlaps(), or sd_join_equals().
A character vector of column names to join on in both tables
A named character vector mapping left-table column names to
right-table column names, e.g. c(x_val = "y_val")
NULL for a natural join on columns with matching names
The type of join to perform. One of "inner", "left", "right", "full", "leftsemi", "rightsemi", "leftanti", "rightanti", "leftmark", or "rightmark".
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
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).
An object of class sedonadb_dataframe
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)