R/variables.R

Defines functions ac an af ai al

Documented in ac af ai al an

#' Variables Conversions
#'
#' @description type less - variable type conversions
#'
#' @section Functions:
#' \describe{
#'   \item{`ac()`}{ac is a shorthand for the base function as.character}
#'
#'   \item{`an()`}{an is a shorthand for the base function as.numeric}
#'
#'   \item{`af()`}{af is a shorthand for the base function as.factor}
#'
#'   \item{`ai()`}{ai is a shorthand for the base function as.integer}
#'
#'   \item{`al()`}{al is a shorthand for the base function as.logical}
#' }
#'
#' @param x variable
#'
#' @seealso \code{as.character, as.numeric, as.factor, as.integer, as.logical} in the base package
#'
#' @name variables
#' @examples
#' ac(1)
#' an("1")
#' af(1)
#' ai(1.00)
#' al(1)
NULL

#' @rdname variables
#' @export
ac  <- function(x) as.character(x)

#' @rdname variables
#' @export
an  <- function(x) as.numeric(x)

#' @rdname variables
#' @export
af  <- function(x) as.factor(x)

#' @rdname variables
#' @export
ai  <- function(x) as.integer(x)

#' @rdname variables
#' @export
al  <- function(x) as.logical(x)
ShaulAb/typeless documentation built on May 28, 2019, 3:15 p.m.