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( na_any(x) ) 
      object[[w]] <- na_replace( x, median(x, na_rm=TRUE ))
    
  }

  return(object)
  
}
decisionpatterns/na.actions documentation built on Aug. 25, 2020, 8:04 p.m.