R/stata_time_to_R_time.R

#' Convert Stata time to R time after using read.dta
#'
#' @param times A time vector to convert.
#'


stata_time_to_R_time<-function(times) {
  if (inherits(times, "POSIXt")) {
    time <- times
  }
  else {
    time<-as.POSIXct(times/1000,origin="1960-01-01",tz="GMT")
  }
	return(time)
}
EcotopeResearch/EcotopePackage documentation built on May 6, 2019, 3:11 p.m.