#' Calculate math problems
#'
#' Takes in any numeric value and squares it.
#' @param x A numeric value to be squared.
#' @return The square of the input
#' @export
square <- function(x) {
return(x^2)
}
#' Cube a number
#' @param x Number to be cubed
#' @return the cube of the input
#' @export
cube <- function(x) {
return(x^3)
}
#' Multiply a number
#' @param xy Numbers to be muliplied
#' @return The multiple of the inputs
#' @export
multiply <- function(x, y) {
return(x*y)
}
#' Divide a number
#' @param xy Numbers to be divided
#' @return The product of the inputs
#' @export
divide <- function(x, y) {
return(x/y)
}
#' Add a number
#' @param xy Numbers to be added
#' @return The sum of the inputs
#' @export
sum <- function(x, y) {
return(x+y)
}
#' Subtract a number
#' @param xy Numbers to be subtracted
#' @return The subtraction of the inputs
#' @export
subtract <- function(x, y) {
return(x-y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.