R/TimeAdd.R

Defines functions TimeAdd

Documented in TimeAdd

#### return time2 in numeric ####

TimeAdd <- function(time1, increase) {
  ## formalize argument ##
  time1 <- as.numeric(time1)
  
  ## calculate end time ##
  seconds1 = TimeDiff(0, time1)
  seconds2 = seconds1 + increase
  if (seconds2 > 24 * 3600) {
    stop('Can not cope more than 1 day.')
  }
  time2 <- SecondsToTime(seconds2)
  
  return(time2)
}

Try the TickExec package in your browser

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

TickExec documentation built on May 2, 2019, 9:58 a.m.