select_first: Select each client's first administration and merge specified...

View source: R/select_first.r

select_firstR Documentation

Select each client's first administration and merge specified CCMH forms

Description

Select each client's first administration and merge specified CCMH forms

Usage

select_first(
  data,
  inner_join_list = NULL,
  left_join_list = NULL,
  order_by = "Date",
  keep_columns_CCAPS = c("UniqueClientID", "CcmhID", "Data_year", "Depression34",
    "Anxiety34", "Social_Anxiety34", "Academics34", "Eating34", "Hostility34",
    "Alcohol34", "DI", "Depression62", "Eating62", "Substance62", "Anxiety62",
    "Hostility62", "Social_Anxiety62", "Family62", "Academics62"),
  keep_columns_SDS = "SDS",
  keep_columns_CLICC = "CLICC",
  keep_columns_Closure = "Closure",
  by_year = FALSE,
  recode_NA_CLICC = FALSE,
  recode_NA_Closure = FALSE
)

Arguments

data

An unquoted string indicating the data frame object name.

inner_join_list

A list of data forms to be inner joined in the final merged data set. Options include: "CCAPS", "SDS", "CLICC", "Closure".

left_join_list

A list of data forms to be left joined in the final merged data set. Options include: "CCAPS", "SDS", "CLICC", "Closure". Data forms listed under inner_join_list must not be listed under left_join_list.

order_by

A quoted string to indicate the variable used to order by when selecting the first administration across data forms.

keep_columns_CCAPS

A string list of column CCAPS names to retain. If not specified, defaults to the relevent columns for CCAPS.

keep_columns_SDS

A string list of column SDS names to retain. If not specified, defaults to the relevent columns for SDS.

keep_columns_CLICC

A string list of column CLICC names to retain. If not specified, defaults to the relevent columns for CLICC.

keep_columns_Closure

A string list of column closure names to retain. If not specified, defaults to the relevent columns for Closure.

by_year

A logical statement to indicate if first administration by year instead of overall. If TRUE, the first administration of each client will be selected by year. If FALSE, the first administration of each client will be selected regardless of year. Default = FALSE.

recode_NA_CLICC

A logical statement to indicate if NA on CLICC should be recoded to 0. If TRUE, NA will be recoded to 0. Default = FALSE.

recode_NA_Closure

A logical statement to indicate if NA on Case Closure should be recoded to 0. If TRUE, NA will be recoded to 0. Default = FALSE.


CCMH-PSU/CCMHr documentation built on Jan. 11, 2025, 4:36 p.m.