Skip to contents

Join two tables by angular distance between `<sky_coord>` columns.

Usage

coord_left_join(
  x,
  y,
  x_coord = NULL,
  y_coord = NULL,
  max_sep,
  unit = "arcsec",
  method = "kdtree",
  multiple = "all",
  keep_sep = TRUE,
  sep_col = "sep",
  suffix = c(".x", ".y")
)

coord_nearest_join(
  x,
  y,
  x_coord = NULL,
  y_coord = NULL,
  unit = "arcsec",
  method = "kdtree",
  keep_sep = TRUE,
  sep_col = "sep",
  suffix = c(".x", ".y")
)

coord_right_join(
  x,
  y,
  x_coord = NULL,
  y_coord = NULL,
  max_sep,
  unit = "arcsec",
  method = "kdtree",
  multiple = "all",
  keep_sep = TRUE,
  sep_col = "sep",
  suffix = c(".x", ".y")
)

coord_full_join(
  x,
  y,
  x_coord = NULL,
  y_coord = NULL,
  max_sep,
  unit = "arcsec",
  method = "kdtree",
  multiple = "all",
  keep_sep = TRUE,
  sep_col = "sep",
  suffix = c(".x", ".y")
)

coord_inner_join(
  x,
  y,
  x_coord = NULL,
  y_coord = NULL,
  max_sep,
  unit = "arcsec",
  method = "kdtree",
  multiple = "all",
  keep_sep = TRUE,
  sep_col = "sep",
  suffix = c(".x", ".y")
)

Arguments

x, y

Data frames (or tibble-like objects).

x_coord, y_coord

Coordinate column in `x`/`y`. Supports bare names or character names. If `NULL`, the first `<sky_coord>` column is auto-detected.

max_sep

Maximum separation threshold passed to [coord_match()]. Used in [coord_left_join()]. [coord_nearest_join()] always uses `Inf`.

unit

Separation unit passed to [coord_match()]: `"arcsec"`, `"arcmin"`, `"deg"`, or `"rad"`.

method

Matching backend passed to [coord_match()]: `"kdtree"` or `"bruteforce"`.

multiple

How to handle multiple matches per row of `x`: `"all"` keeps all matches, `"closest"` keeps one nearest match per `x` row. Used in [coord_left_join()].

keep_sep

If `TRUE`, append the separation column to output.

sep_col

Name of the separation column in output.

suffix

Length-2 character vector for duplicate non-key column names.

Value

A joined table. Currently returned as a base `data.frame`.