README.md

Introduction

This is a practice package for STAT545 course. The foofactors package has a three cool functions to make working with factors easier and fun. Look at the "Usage" section below or the vignette for examples.

Installation:

install_github("KPdir/foofactors")

Load in R:

library(foofactors)

Usage

Exmaple use of fbind

fbind(iris$Species[c(1, 51, 101)], PlantGrowth$group[c(1, 11, 21)])
#> [1] setosa     versicolor virginica  ctrl       trt1       trt2      
#> Levels: ctrl setosa trt1 trt2 versicolor virginica

Exmaple use of freq_out

freq_out(iris$Species)
#> Source: local data frame [3 x 2]
#> 
#>            x     n
#>       (fctr) (int)
#> 1     setosa    50
#> 2 versicolor    50
#> 3  virginica    50

Exmaple use of splitlevel

x <- data.frame(first = c(1:6), second = rep(c("A","B"), each = 3), third = rep_len(c("W","X","Y","Z"), 6))
splitlevel(x,"second","A","third", "callitwhatyouwant")
#>   first second third callitwhatyouwant
#> 1     1      A     W               A_W
#> 2     2      A     X               A_X
#> 3     3      A     Y               A_Y
#> 4     4      B     Z                 B
#> 5     5      B     W                 B
#> 6     6      B     X                 B

ENJOY!!!



KPdir/foofactors documentation built on May 8, 2019, 4:41 p.m.