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

infact

The goal of infact is to provide a set of function to streamline working with factors

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("mncube/infact")

Example

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

library(infact)
## basic example code
#Create dataframe
Saturday_Money <-sample(0:1,20,replace=TRUE)
Sunday_Money   <-sample(1:2,20,replace=TRUE)
Sat_Work       <-sample(c("Play", "Work"), 20, replace=TRUE)
Sun_Work       <-sample(c("Play", "Work"), 20, replace=TRUE)
df1<-data.frame(Saturday_Money, Sat_Work, Sunday_Money, Sun_Work)

#Convert columns to binary factors
df1_fact <- mut_bin(df1, vec = c(1, 2,3,4))
df1_fact

#Get information on the factor in column 1
finfo(df1_fact, 1)


mncube/infact documentation built on Dec. 21, 2021, 8:07 p.m.