The function creates a frequency table of a factorial variable.

FacTable(fac, VARNAME = NULL, NOZEROS = T, SORT = F)

Arguments

fac

is a factorial variable

VARNAME,

default=NULL, name the variable, if NULL, VARNAME generated from fac

NOZEROS,

removed if 0 observations, TRUE is default

SORT,

sort ascending, FALSE is default

Value

a frequency table

Details

FacTable

Examples

if (FALSE) { fac<-c(rep("D",56),rep("F",23),rep("AT",5)) fac<-factor(fac,levels=c("AT","B","D","F")) table(fac) FacTable(fac,NOZEROS=F) FacTable(fac,NOZEROS=F,SORT=F) FacTable(fac,VARNAME="Country Codes",NOZEROS=F,SORT=F) gr<-factor(c(rep("Gr1",100),rep("Gr2",200))) FacTable(gr) gg<-c(rep("Gr1",100),rep("Gr2",200),SORT=F) FacTable(gg) gn<-c(rep(1,100),rep(2,200)) FacTable(gn,VARNAME="NumerischerVektor") }