R/fbind.R

Defines functions fbind

Documented in fbind

#' 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
#' @export
#'
#' @examples
#' fbind( factor(letters[1:3]), factor(letters[4:6]) )
fbind <- function(a, b) {
  factor(c(as.character(a), as.character(b)))
}
SamT123/foofactors documentation built on Dec. 31, 2020, 4:28 p.m.