R/pscData_addtrt.R

Defines functions pscData_addtrt

Documented in pscData_addtrt

#' A function that includes a treatment indicator when multiple
#' treatment comparisons are required
#'
#' The purpose of this function is to organise a treatment indicator where
#' multiple treatment comparisons are being evaluated. This acts as a
#' sub-function to the pscData.R function.
#'
#' @param DC a data cohort to be 'cleaned'
#' @param trt a treatment indicator
#' @return a dataset which is checked and compatible with the CFM
pscData_addtrt <- function(DC,trt){
  DC <- data.frame(cbind(DC,trt))
  trt.nm <- names(DC)[ncol(DC)]
  ret <- list(DC,trt.nm)
}

Try the psc package in your browser

Any scripts or data that you put into this service are public.

psc documentation built on June 8, 2026, 5:06 p.m.