R/is.long.R

Defines functions is.long

Documented in is.long

#' Is Dataframe In Long Format?
#'
#' @description Make sure the dataset is in long format and that the last two columns are always a named variable and value.
#' @param df The source dataset
#' @export

is.long <- function(df){

  r <- TRUE
  l <- length(names(df))
  n <- names(df)

  if (n[l - 1] != "variable")
    r <- FALSE
  if (n[l] != "value")
    r <- FALSE

  r

}
MattjCamp/datapointsr documentation built on Sept. 14, 2023, 12:43 p.m.