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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.