# NOT RUN {
# load sample data
library(sjmisc)
data(efc)
# show frequencies of "e42dep" in RStudio Viewer Pane
# or default web browser
sjt.frq(efc$e42dep)
# plot and show frequency table of "e42dep" with labels
sjt.frq(efc$e42dep, title = "Dependency",
value.labels = c("independent", "slightly dependent",
"moderately dependent", "severely dependent"))
# plot frequencies of e42dep, e16sex and c172code in one HTML file
# and show table in RStudio Viewer Pane or default web browser
# Note that value.labels of multiple variables have to be
# list-objects
sjt.frq(data.frame(efc$e42dep, efc$e16sex, efc$c172code),
title = c("Dependency", "Gender", "Education"),
value.labels = list(c("independent", "slightly dependent",
"moderately dependent", "severely dependent"),
c("male", "female"), c("low", "mid", "high")))
# auto-detection of labels
sjt.frq(data.frame(efc$e42dep, efc$e16sex, efc$c172code))
# plot larger scale including zero-counts
# indicating median and quartiles
sjt.frq(efc$neg_c_7, emph.md = TRUE, emph.quart = TRUE)
# sort frequencies
sjt.frq(efc$e42dep, sort.frq = "desc")
# User defined style sheet
sjt.frq(efc$e42dep,
CSS = list(css.table = "border: 2px solid;",
css.tdata = "border: 1px solid;",
css.firsttablecol = "color:#003399; font-weight:bold;"))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab