R/objects.R

Defines functions adf am

Documented in adf am

#' Objects Type Conversions
#'
#' @description type less - object type conversions
#'
#' @section Functions:
#' \describe{
#'   \item{`adf()`}{adf is a shorthand for the base function as.data.frame}
#'
#'   \item{`am()`}{am is a shorthand for the base function as.matrix}
#' }
#'
#' @param x tabular data object
#' @param ... other parameters passed onto methods
#'
#' @seealso \code{as.data.frame} and \code{as.matrix} in the base package
#'
#' @name objects
#' @examples
#' # example conversions
#' irisMatrix <- am(iris)
#' irisDataFrame <- adf(irisMatrix)
#'
#' # check the class
#' class(irisMatrix)
#' class(irisDataFrame)
NULL

#' @rdname objects
#' @export
adf <- function(x, ...) as.data.frame(x, ...)

#' @rdname objects
#' @export
am  <- function(x, ...) as.matrix(x, ...)

# You can learn more about package authoring with RStudio at:
#
#   http://r-pkgs.had.co.nz/
#
# Some useful keyboard shortcuts for package authoring:
#
#   Build and Reload Package:  'Ctrl + Shift + B'
#   Check Package:             'Ctrl + Shift + E'
#   Test Package:              'Ctrl + Shift + T'
ShaulAb/typeless documentation built on May 28, 2019, 3:15 p.m.