knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "NV>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

FooFactors

Factors are a very useful type of variable in R, but they can also be very aggravating. This package provides some helper functions for the care and feeding of factors.

Installation

You can install the released version of FooFactors from CRAN with:

install.packages("FooFactors")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("shakkyaNV/FooFactors")

Example

This is a basic example which shows you how to solve a common problem:

library(FooFactors)

Binding two factors via fac_bind():

a <- factor(c("character", "hits", "your", "eyeballs"))
b <- factor(c("but", "integer", "where it", "counts"))

Simply concatenating two factors leads to a result that most don't expect.

c(a, b)

The fbind() function glues two factors together and returns factor.

fac_bind(a, b)


shakkyaNV/FooFactors documentation built on March 8, 2021, 12:08 a.m.