R/methods_various.R

Defines functions as.data.frame.packageIQR

Documented in as.data.frame.packageIQR

#' Formula to character
#'
#' @param x formula
#' @param \ldots unused
#' @examples
#' f <-  aha ~ hih + oho
#' as.character(f)
#' @export
mat_formu_to_char <- function (x, ...) {
  form <- paste(deparse(x), collapse = " ")
  form <- gsub("\\s+", " ", form, perl = FALSE)
  return(form)
}


#' As data frame for data()
#'
#' @param x formula
#' @param \ldots unused
#' @param stringsAsFactors cf \code{\link{as.data.frame}}
#' @examples
#' datas <-  data()
#' head(as.data.frame(datas))
#' @export
as.data.frame.packageIQR <-  function(x, ..., stringsAsFactors = FALSE) {
  as.data.frame(x$results, ..., stringsAsFactors=stringsAsFactors)
}
MatthieuStigler/matPkg documentation built on Sept. 19, 2024, 5:19 a.m.