View source: R/matching_utils.R
| extract_ids | R Documentation |
The id a matching carries is the key every downstream verb joins on, so it
is resolved once, here, and the same resolution answers match_couples()
and join_matched(). id_col names the column to read; with no name given
a column called id is used, then meaningful row names, then ids
synthesized from prefix.
extract_ids(df, prefix = "id", id_col = NULL, warn_synthetic = FALSE)
df |
Data frame to read ids from. |
prefix |
Prefix for synthesized ids, also the side name used in messages ("left" / "right"). |
id_col |
Name of the id column, or NULL to resolve one. |
warn_synthetic |
If TRUE, warn when ids are synthesized because no id column was named or found. |
Ids read from the data must be unique: a repeated value makes every id-keyed join downstream many-to-many, which expands rows and attaches one unit's covariates to another unit's pair. Synthesized ids are unique by construction and are not checked.
Character vector of IDs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.