# Put the definition of fbind() and only the definition of fbind() in R/fbind.R and save it.
# The file R/fbind.R should NOT contain any of the other top-level code we have recently executed,
# such as the definitions of factors a and b, library(devtools) or use_git()
# use roxygen2 to add this automatically - shift + option + cmd + R
#' Bind the two factors
#'
#' @param a first char vec
#' @param b second char vec
#'
#' @return factor
#' @export
#'
#' @examples
#' fbind(iris$Species[c(1, 51, 101)], PlantGrowth$group[c(1, 11, 21)])
fbind <- function(a, b) {
factor(c(as.character(a), as.character(b)))
}
# then run document() (cmd + shift + D)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.