R/bayessurvreg3.checkStore.R

Defines functions bayessurvreg3.checkStore

Documented in bayessurvreg3.checkStore

##################################################
#### AUTHOR:     Arnost Komarek               ####
####             (2005)                       ####
####                                          ####
#### FILE:       bayessurvreg3.checkStore.R   ####
####                                          ####
#### FUNCTIONS:  bayessurvreg3.checkStore     ####
##################################################

### ======================================
### bayessurvreg3.checkStore
### ======================================
bayessurvreg3.checkStore <- function(store)
{
  if(length(store) == 0) instore <- "arnost"
  else                   instore <- names(store)

  ia <- match("a", instore, nomatch=NA)
  if(is.na(ia)) store$a <- FALSE
  if (!is.logical(store$a)) store$a <- FALSE
  
  iy <- match("y", instore, nomatch=NA)
  if(is.na(iy)) store$y <- FALSE
  if (!is.logical(store$y)) store$y <- FALSE

  ir <- match("r", instore, nomatch=NA)
  if(is.na(ir)) store$r <- FALSE
  if (!is.logical(store$r)) store$r <- FALSE

  ib <- match("b", instore, nomatch=NA)
  if(is.na(ib)) store$b <- FALSE
  if (!is.logical(store$b)) store$b <- FALSE

  iab <- match("a.b", instore, nomatch=NA)
  if(is.na(iab)) store$a.b <- FALSE
  if (!is.logical(store$a.b)) store$a.b <- FALSE

  irb <- match("r.b", instore, nomatch=NA)
  if(is.na(irb)) store$r.b <- FALSE
  if (!is.logical(store$r.b)) store$r.b <- FALSE

  
  ia2 <- match("a2", instore, nomatch=NA)
  if(is.na(ia2)) store$a2 <- FALSE
  if (!is.logical(store$a2)) store$a2 <- FALSE

  iy2 <- match("y2", instore, nomatch=NA)
  if(is.na(iy2)) store$y2 <- FALSE
  if (!is.logical(store$y2)) store$y2 <- FALSE

  ir2 <- match("r2", instore, nomatch=NA)
  if(is.na(ir2)) store$r2 <- FALSE
  if (!is.logical(store$r2)) store$r2 <- FALSE

  ib2 <- match("b2", instore, nomatch=NA)
  if(is.na(ib2)) store$b2 <- FALSE
  if (!is.logical(store$b2)) store$b2 <- FALSE

  iab2 <- match("a.b2", instore, nomatch=NA)
  if(is.na(iab2)) store$a.b2 <- FALSE
  if (!is.logical(store$a.b2)) store$a.b2 <- FALSE

  irb2 <- match("r.b2", instore, nomatch=NA)
  if(is.na(irb2)) store$r.b2 <- FALSE
  if (!is.logical(store$r.b2)) store$r.b2 <- FALSE
  
  return(store)  
}  

Try the bayesSurv package in your browser

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

bayesSurv documentation built on May 2, 2019, 3:26 a.m.