R/kidsR.R

#' An addition problem function
#'
#' This allows you to put in two numbers to add then what you think the answer is.
#' @param number1,number2,answer
#' @export
#' @examples 
#' add()

add <- function(number1, number2, answer){
  if(number1 + number2 == answer){
    print("Correct!")
  } else {
    print("Not quite, keep trying")
  }
  
}

#' A subtraction problem function
#'
#' This allows you to put in two numbers to subtract then what you think the answer is.
#' @param number1,number2,answer
#' @export
#' @examples 
#' subtract()

subtract <- function(number1, number2, answer){
  if(number1 - number2 == answer){
    print("Correct!")
  } else {
    print("Not quite, keep trying")
  }
  
}

#' A multiplication problem function
#'
#' This allows you to put in two numbers to mutliply then what you think the answer is.
#' @param number1,number2,answer
#' @export
#' @examples 
#' multiply()

multiply <- function(number1, number2, answer){
  if(number1 * number2 == answer){
    print("Correct!")
  } else {
    print("Not quite, keep trying")
  }
  
}


#' A division problem function
#'
#' This allows you to put in two numbers to divide then what you think the answer is.
#' @param number1,number2,answer
#' @export
#' @examples 
#' multiply()

divide <- function(number1, number2, answer){
  if(number1/number2 == answer){
    print("Correct!")
  } else {
    print("Not quite, keep trying")
  }
  
}


#' Inventory list for minecraft.
#'
#' a dataset containing a minecraft inventory item list.
#'
#' @format A data frame with 327 rows and 4 variables:
#' \describe{
#'   \item{item}{name of actual item}
#'   \item{id}{unique integer for each item}
#'   \item{name}{technical name for each item}
#'   \item{type}{identified minecraft type for each item}
#' }
"minecraft_items"
nhemerson/kidsR documentation built on May 27, 2019, 1:09 p.m.