R/na.roughfix.POSIXct.R

Defines functions na.roughfix.POSIXct

Documented in na.roughfix.POSIXct

#' na.roughfix.POXIXct - replace a date/time field 
#' 
#' @param object to replace \code{NA}s with
#' 
#' @export

na.roughfix.POSIXct <- function(object) { 

  dts <- classes( object ) == 'POSIXct'
  wh <- dts[dts]
  for( w in names(wh) ) {
    x <- object[[w]]
    if( any_na(x) ) 
      object[[w]] <- na_replace( x, median(x, na.rm=TRUE ))
    
  }

  return(object)
  
}
decisionpatterns/na.actions documentation built on May 12, 2017, 9:55 p.m.