# 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)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.