R/pscData_miss.R

Defines functions pscData_miss

Documented in pscData_miss

#' A function which removes missing data from the DC
#'
#' Currently the psc package works only on complete-case datasets.  This
#' function removes rows with missing data and returns a warning to inform the
#' user. This acts as a sub-function to the pscData.R function.
#'
#' @param DC a data cohort to be 'cleaned'
#' @return a dataset with missing data removed
pscData_miss <- function(DC){
  miss.id <- which(is.na(DC),arr.ind=T)[,1];miss.id
  if(length(miss.id)>0) {
    DC <- DC[-miss.id,]
    warning(paste(length(miss.id),"rows removed due to missing data in dataset"))
  }
  DC
}

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.