R/misc-functions.R

# Helper Functions

# checkInput for dataframe
checkInput <- function(x) {
  # Make sure input is either a matrix or a dataframe
  if (is.matrix(x)){
    x <- as.data.frame(x)
  }
  
  if (!is.data.frame(x))
    stop("input must be a data.frame or matrix object")
  
  return(x)
}

# Within-Person Standard Deviation
mattsigal/careless documentation built on May 21, 2019, 1:25 p.m.