R/toyfunctions.R

Defines functions fbind cubeme goodbye hello

Documented in cubeme fbind goodbye hello

# Hello, world!
#
# This is an example function named 'hello'
# which prints 'Hello, world!'.
#
# You can learn more about package authoring with RStudio at:
#
#   http://r-pkgs.had.co.nz/
#
# Some useful keyboard shortcuts for package authoring:
#
#   Install Package:           'Ctrl + Shift + B'
#   Check Package:             'Ctrl + Shift + E'
#   Test Package:              'Ctrl + Shift + T'

hello <- function() {
  print("Hello, world!")
}


#' say goodbye
#'
#' @return a string
#' @export
#'
#' @examples
#' goodbye()
goodbye <- function() {
  print("Goodbye, world!")
}


#' Cube a value
#'
#' @param x a numeric value
#'
#' @return the cube of the value entered
#' @export
#'
#' @examples
#' cubeme(5)
cubeme <- function(x) {
  x ** 3
}


#' printing factor comparisons
#'
#' @param a text string
#' @param b another text string
#'
#' @return resulting factors
#' @export
#'
#' @examples
#' fbind("jerry", "sally)
fbind <- function(a, b) {
  factor(c(as.character(a), as.character(b)))
}
amkessler/aktestpackage documentation built on Jan. 3, 2021, 12:31 a.m.