View source: R/fct_join_tables.R
join_tables | R Documentation |
Perform an inner join or left join operation on two layers based on n number of primary and foreign keys. Perform joins using dplyr's inner_join and left_join functions.
join_tables(f_left, f_right, j_type, pk, fk)
f_left |
layer with primary keys and left table in joins. |
f_right |
layer with foreign keys and right table in joins. For non-spatial joins this must be a non-spatial data frame - if it is a spatial data frame (i.e. of class sf) it will be converted to non-spatial. |
j_type |
a string specifying the type of join to perform. |
pk |
a character vector of primary keys. The primary and foreign keys do not need to have the same names but the order of the keys matters. |
fk |
a character vector of foreign keys. The primary and foreign keys do not need to have the same names but the order of the keys matters. |
Primary and foreign keys are converted to character vectors before joining.
j_df
A layer joined on primary and foreign keys. Will be of
class sf(i.e. spatial features) if f_left is spatial. Otherwise returns a data frame.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.