library(procs)
# Turn off printing for CRAN checks
# Set to TRUE to run in local environment
options("procs.print" = FALSE)
# Prepare sample data
dt <- as.data.frame(HairEyeColor, stringsAsFactors = FALSE)
# Example 1: Single plot request for all tables
res <- proc_freq(dt, tables = v(Hair, Eye, Hair * Eye),
weight = Freq,
plots = freqplot(type = "dotplot"),
titles = "Hair and Eye Frequency Statistics")
# View results
res
# Example 2: Separate plots request for each table
res <- proc_freq(dt, tables = v(Hair, Eye, Hair * Eye),
weight = Freq,
plots = list(freqplot(type = "barchart",
orient = "horizontal"),
freqplot(type = "dotplot",
scale = "percent"),
freqplot(type = "barchart",
twoway = "cluster")),
titles = "Hair and Eye Frequency Statistics")
# View results
res
# Example 3: Display options for group orientation
res <- proc_freq(dt, tables = v(Hair * Eye, Eye * Hair),
weight = Freq,
plots = list(freqplot(type = "dotplot",
twoway = "grouphorizontal"),
freqplot(type = "dotplot",
twoway = "groupvertical")),
titles = "Hair and Eye Frequency Statistics")
# View results
res
Run the code above in your browser using DataLab