foofactors package

The foofactors package has 3 functions and this is a demo of how the functions work.

#install_github("jokagyeman/foofacotrs")
library(foofactors)

fbind()

Description

The first function is fbind which puts two factors together as one.

#Here is an example,

fbind(iris$Species[c(1,51,101)], PlantGrowth$group[c(1,11,21)])

freq_out()

Description

The second function is freq_out, which gives you a dataframe with factors and their frequency.

# Here is an example

freq_out(iris$Species)

f_keep()

Description

The third function is f_keep, which prints factor levels as they are in the r object.

# Here is an example

sons <- factor(c("John", "Caleb", "Joel"))

f_keep(sons)

f_nchar()

Description

This function counts the length of factor level names and prints it in a table arrange in descending order.

# Here is an example

Subjects <- factor(c("Mathematics", "Statistics", "English", "French"))

f_nchar(Subjects)


jokagyeman/foofactors documentation built on May 19, 2019, 5:18 p.m.