proc_freq: A "PROC FREQ" for R

View source: R/proc_freq.R

proc_freqR Documentation

A "PROC FREQ" for R

Description

An R function to do some of the calcuations thatt SAS's PROC FREQ does. I found this function on page 10 of An Introduction to Categorical Data Analysis Using R by Brett Presnell. It's just too fun not to include this somehow. See references for link.

Usage

proc_freq(x, digits = 4)

Arguments

x

A table or matrix

digits

Doesn't do anything that I can tell

Value

A list

References

/urlhttp://users.stat.ufl.edu/~presnell/Courses/sta4504-2000sp/R/R-CDA.pdf

Examples

jobsatis <- c(2,4,13,3, 2,6,22,4, 0,1,15,8, 0,3,13,8)
jobsatis <- matrix(jobsatis,byrow=TRUE,nrow=4)
dimnames(jobsatis) <- list(
  Income=c("<5","5-15","15-25",">25"),
  Satisfac=c("VD","LS","MS","VS"))
jobsatis
class(jobsatis)

jobsat_freq <- proc_freq(jobsatis)
jobsat_freq

library(vcd)
SexualFun
class(SexualFun)

proc_freq(SexualFun)


emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.