R/add_EVID.R

Defines functions add_EVID

add_EVID <- function(d1) {
  # trying to implement EVID if not presented
  rowsWithObs <- !is.na(d1$ObsName)
  if ("EVID" %in% colnames(d1)) {
    d1$EVID[rowsWithObs] <- 0
    # prevent any NAs in EVID
    d1$EVID[is.na(d1$EVID)] <- 2
  } else {
    # create EVID column
    d1$EVID <- 2
    d1$EVID[rowsWithObs] <- 0
  }

  d1
}

Try the Certara.Xpose.NLME package in your browser

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

Certara.Xpose.NLME documentation built on April 3, 2025, 7:45 p.m.