#' The sum !
#'
#'This \strong{wonderful} function will calculate for you the sum of any two numerical vectors.
#'
#'For more details see \url{https://en.wikipedia.org/wiki/Summation}.
#'
#' @param x A \code{numeric} vector
#' @param y A \code{numeric} vector
#' @param plot A \code{logical} argument to produce (\code{plot = TRUE}) or not a plot.
#'
#' @return A \code{numeric} vector of \code{x+y} and, if \code{plot = TRUE}, a plot of \code{y} vs \code{x}.
#'
#' @export
#'
#' @examples
#' # sum of two numbers
#' add(1, 1)
#'
#' # sum of two vectors
#' add(c(1,2),1:8)
#'
add <- function(x, y, plot = FALSE) {
if(!plot) return(c(x,y))
else if(length(x) == length(y)) {print(ggplot2::qplot(x,y))}
return(c(x,y))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.