R/cat-function.R

# sourced from : https://hilaryparker.com/

# =============================================
# SETUP. load required packages
# =============================================
#library("devtools")
#library("roxygen2")

# =============================================
# STEP 1. create directory
# =============================================
#setwd("D:/R")
#create("cats")

# =============================================
# STEP 2 and 3. create function and document it
# =============================================

#' A Cat Function
#'
#' This function allows you to express your love of cats.
#' @param love Do you love cats? Defaults to TRUE.
#' @keywords cats
#' @export
#' @examples
#' cat_function()

cat_function <- function(love=TRUE){
  if(love==TRUE){
    print("I love cats!")
  }
  else {
    print("I am not a cool person.")
  }
}

# =============================================
# STEP 4. Process documentation
# =============================================
#setwd("D:/R/cats")
#document()
suzannefox/cats-test documentation built on May 30, 2019, 8:44 p.m.