link_data_frames: Link Data Frames within R-Instat

View source: R/link_data_frames.R

link_data_framesR Documentation

Description

This function links two data frames within the R-Instat environment using specified linking pairs. It is specifically designed for use within R-Instat and will stop with an error message if the data book object is not found, indicating that the data frames are not being managed through R-Instat.

Usage

link_data_frames(
  from_data_frame = "flow_data",
  to_data_frame = "user_data",
  link_pairs = c(uuid = "uuid")
)

Arguments

from_data_frame

The name of the source data frame to link from, defaults to "flow_data".

to_data_frame

The name of the target data frame to link to, defaults to "user_data".

link_pairs

A named vector that specifies the column names used to establish the link, with the name being the column in the from_data_frame and the value being the corresponding column in the to_data_frame. Defaults to linking "uuid" in both data frames.

Value

None; the function modifies the data_book environment by adding a new link.

Examples

# Assuming 'data_book' and required data frames are already loaded in R-Instat:
# link_data_frames("survey_data", "participant_data", c(participant_id="id"))


lilyclements/Rapidreadr documentation built on April 17, 2025, 6:10 p.m.