R/regularize_data.R

Defines functions timeLags

#'data frame with added column timelag  
#'
#'@param x is a movestack object
#'@return product histogram of timelags
#'@export


timeLags <- function(x){
  x$timelag <- unlist(lapply(timeLag(x, units='secs'), c, NA)) 
  product <- ggplot(x@data)+geom_histogram(aes(x = timelag)) +xlim(0, 100)
  if(is.ggplot(product) == FALSE){
    return("ERROR - non plot")
  }
  return(product)
  
}
MicaelaP24/R_Package_Pineda documentation built on Dec. 17, 2021, 4:14 a.m.