select_first_CCAPS: Select each client's first administration of a specified...

View source: R/select_first_CCAPS.R

select_first_CCAPSR Documentation

Select each client's first administration of a specified survey

Description

Select each client's first administration of a specified survey

Usage

select_first_CCAPS(
  data,
  order_by = "Date",
  keep_all = FALSE,
  keep_columns = c("UniqueClientID", "CcmhID", "Data_year", "Depression34", "Anxiety34",
    "Social_Anxiety34", "Academics34", "Eating34", "Hostility34", "Alcohol34", "DI",
    "Depression62", "Eating62", "Substance62", "Anxiety62", "Hostility62",
    "Social_Anxiety62", "Family62", "Academics62"),
  by_year = FALSE
)

select_first_SDS(
  data,
  order_by = "Date",
  keep_all = FALSE,
  keep_columns = "SDS",
  by_year = FALSE
)

select_first_CLICC(
  data,
  order_by = "Date",
  keep_all = FALSE,
  keep_columns = "CLICC",
  by_year = FALSE,
  recode_NA = FALSE
)

select_first_Closure(
  data,
  order_by = "Date",
  keep_all = FALSE,
  keep_columns = "Closure",
  by_year = FALSE,
  recode_NA = FALSE
)

Arguments

data

data frame

order_by

variable to order by when selecting the first administration.

keep_all

Columns to keep. TRUE will keep all columns, while FALSE will keep only IDs and CCAPS subscales, SDS items, or CLICC items.

keep_columns

A string list of column names to retain. If not specified, and keep_all = FALSE, defaults to the relevent columns for that data form.

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

A logical statement to indicate if NA 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.