This is a homework package for stat 547. "foofactors" manipulates factors and makes them easier to deal with. Functions include: fbind to bind two factors together

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

freq_out to tabulate a factor

freq_out(iris$Species)

fctr_or_chr to determine whether input factor should be a factor or character depending on whether distinct levels = observations. Returns TRUE if factor.

levels(iris$Species)
length(iris$Species)
#Is the Species variable a factor or not? 
fctr_or_chr(iris$Species)

reorder_factor to reorder the levels in a factor in descending order

levels(iris$Species)

reorder_factor(iris$Species)


Poush87/foofactors documentation built on May 8, 2019, 3:09 p.m.