query_subjects: Query Subjects Across Instruments by External Dataframe

View source: R/query_subjects.R

query_subjectsR Documentation

Query Subjects Across Instruments by External Dataframe

Description

This function utilizes the output of extract_infos, which can then be filtered according to some criteria, to filter the list of dataframes from split_instruments. This lets us avoid having to utilize apply or map functions to apply a particular filter like "Only the Project A patients at baseline."

Usage

query_subjects(
  instrument_db,
  filter_specification,
  join_info = TRUE,
  limit_cols = FALSE,
  include_cols = NA,
  record_id_col = "record_id"
)

Arguments

instrument_db

List of dataframes, the output from split_instruments

filter_specification

Dataframe, the output from extract_infos which can be filtered as desired

join_info

Logical, defaults to True, should this function add the info from the filter specification dataframe such as age and time since onset?

limit_cols

Logical, assuming join_info is True, if this is False, then include all additional columns from the filter specification. If this is True, then include only the columns given by include_cols

include_cols

Character Vector, vector of which columns to include. Must be present in filter_specification.

record_id_col

Defaults to record_id

Value

A list of instruments filtered according to the records provided by the filter specification data frame


tsostarics/anrlab documentation built on Nov. 6, 2022, 3:54 a.m.