knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of infact is to provide a set of function to streamline working with factors
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("mncube/infact")
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.