R/fbind.R

(a <- factor(c("character", "hits", "your", "eyeballs")))

(b <- factor(c("but", "integer", "where it", "counts")))

#' Bind two factors
#'
#' Create a new factor from two existing factors, where the new factor's levels
#' are the union of the levels of the input factors.
#'
#' @param a factor
#' @param b factor
#'
#' @return factor
fbind <- function(a, b) {
  factor(c(as.character(a), as.character(b)))
}
Tepplin/booFactors documentation built on May 12, 2019, 5:22 p.m.