## Basics:
# (1) Plotting global freq and prob values:
plot_tab()
plot_tab(area = "sq", f_lwd = 3, col_pal = pal_rgb)
plot_tab(f_lbl = "namnum", f_lbl_sep = " = ", brd_w = .10, f_lwd = .5)
# (2) Computing local freq and prob values:
plot_tab(prev = .5, sens = 4/5, spec = 3/5, N = 10, f_lwd = 1)
# (3) Rounding and sampling:
plot_tab(N = 100, prev = 1/3, sens = 2/3, spec = 6/7, round = FALSE)
plot_tab(N = 100, prev = 1/3, sens = 2/3, spec = 6/7, sample = TRUE)
## Plot versions:
# by x p_split [yields (3 x 2) x 2] = 12 versions]:
plot_tab(by = "cddc", p_split = "v", p_lbl = "def") # v01 (see v07)
plot_tab(by = "cdac", p_split = "v", p_lbl = "def") # v02 (see v11)
plot_tab(by = "cddc", p_split = "h", p_lbl = "def") # v03 (see v05)
plot_tab(by = "cdac", p_split = "h", p_lbl = "def") # v04 (see v09)
# plot_tab(by = "dccd", p_split = "h", p_lbl = "def") # v07 (v01 rotated)
# plot_tab(by = "dccd", p_split = "v", p_lbl = "def") # v05 (v03 rotated)
plot_tab(by = "dcac", p_split = "v", p_lbl = "def") # v06 (see v12)
plot_tab(by = "dcac", p_split = "h", p_lbl = "def") # v08 (see v10)
# plot_tab(by = "accd", p_split = "v", p_lbl = "def") # v09 (v04 rotated)
# plot_tab(by = "acdc", p_split = "v", p_lbl = "def") # v10 (v08 rotated)
# plot_tab(by = "accd", p_split = "h", p_lbl = "def") # v11 (v02 rotated)
# plot_tab(by = "acdc", p_split = "h", p_lbl = "def") # v12 (v06 rotated)
## Explore labels and links:
# plot_tab(f_lbl = "abb", p_lbl = NA) # abbr. labels, no probability links
# plot_tab(f_lbl = "num", f_lbl_sum = "abb", p_lbl = "num", f_lbl_hd = "abb")
plot_tab(f_lbl = "def", f_lbl_sum = "def", p_lbl = "def", f_lbl_hd = "nam")
plot_tab(f_lbl = "namnum", f_lbl_sep = " = ",
f_lbl_sum = "namnum", f_lbl_hd = "num", p_lbl = "namnum")
## Misc. options:
plot_tab(area = "sq") # area: square
# plot_tab(main = "") # no titles
# plot_tab(mar_notes = TRUE) # show margin notes
plot_tab(by = "cddc", gaps = c(.08, .00), area = "sq") # gaps
# plot_tab(by = "cddc", gaps = c(.02, .08), p_split = "h") # gaps
# Showing prob as lines:
plot_tab(prev = 1/4, sens = 6/7, spec = 3/5, N = 100,
by = "cddc", p_split = "v", col_pal = pal_rgb,
p_lbl = "def", brd_dis = .25, arr_c = +3, lwd = 2)
# Custom text labels and colors:
plot_tab(prev = .5, sens = 4/5, spec = 3/5, N = 10,
by = "cddc", p_split = "v", area = "no",
main = "Main title", sub = "The subtitle", lbl_txt = txt_TF, # custom text
f_lbl = "namnum", f_lbl_sep = ":\n", f_lbl_sum = "num", f_lbl_hd = "nam",
col_pal = pal_vir, f_lwd = 3) # custom colors
plot_tab(prev = .5, sens = 3/5, spec = 4/5, N = 10,
by = "cddc", p_split = "h", area = "sq",
main = NA, sub = NA, lbl_txt = txt_org, # custom text
f_lbl = "namnum", f_lbl_sep = ":\n", f_lbl_sum = "num", f_lbl_hd = "nam",
col_pal = pal_kn, f_lwd = 1) # custom colors
## Note some differences to plot_area (i.e., area/mosaic plot):
# In plot_tab:
# (1) p_split does not matter (except for selecting different prob links):
plot_tab(by = "cddc", p_split = "v") # v01 (see v07)
plot_tab(by = "cddc", p_split = "h") # v03 (see v05)
# (2) scale does not matter for dimensions (which are constant),
# BUT matters for values shown in prob links and on margins:
plot_tab(N = 5, prev = .3, sens = .9, spec = .5,
by = "cddc", scale = "p", p_lbl = "def", round = TRUE) # (a) exact prob values
plot_tab(N = 5, prev = .3, sens = .9, spec = .5,
by = "cddc", scale = "f", p_lbl = "def", round = TRUE) # (b) prob from rounded freq!
plot_tab(N = 5, prev = .3, sens = .9, spec = .5,
by = "cddc", scale = "f", p_lbl = "def", round = FALSE) # (c) same values as (a)
Run the code above in your browser using DataLab