Description Usage Arguments Details Value See Also Examples
plot_fnet
draws a network diagram of
frequencies (as nodes) and probabilities (as edges)
from a sufficient and valid set of 3 essential probabilities
(prev
, and
sens
or its complement mirt
, and
spec
or its complement fart
)
or existing frequency information freq
and a population size of N
individuals.
1 2 3 4 5 6 7 8 9 10  plot_fnet(prev = num$prev, sens = num$sens, mirt = NA, spec = num$spec,
fart = NA, N = freq$N, round = TRUE, by = "cddc", area = "sq",
p.lbl = "num", show.accu = TRUE, w.acc = 0.5,
title.lbl = txt$scen.lbl, popu.lbl = txt$popu.lbl,
cond.true.lbl = txt$cond.true.lbl, cond.false.lbl = txt$cond.false.lbl,
dec.pos.lbl = txt$dec.pos.lbl, dec.neg.lbl = txt$dec.neg.lbl,
hi.lbl = txt$hi.lbl, mi.lbl = txt$mi.lbl, fa.lbl = txt$fa.lbl,
cr.lbl = txt$cr.lbl, col.txt = grey(0.01, alpha = 0.99), box.cex = 0.85,
col.boxes = pal, col.border = grey(0.33, alpha = 0.99), lwd = 1.5,
box.lwd = 1.5, col.shadow = grey(0.11, alpha = 0.99), cex.shadow = 0)

prev 
The condition's prevalence 
sens 
The decision's sensitivity 
mirt 
The decision's miss rate 
spec 
The decision's specificity value 
fart 
The decision's false alarm rate 
N 
The number of individuals in the population.
A suitable value of 
round 
A Boolean option specifying whether computed frequencies
are rounded to integers. Default: 
by 
A character code specifying the perspective (or 1st category by which the population is split into subsets) with 4 options:

area 
A character code specifying the area of the boxes (or their relative sizes) with 4 options:

p.lbl 
A character code specifying the type of probability information (on edges) with 4 options:

show.accu 
Option for showing current
accuracy metrics 
w.acc 
Weigthing parameter Various other options allow the customization of text labels and colors: 
title.lbl 
Text label for current plot title.
Default: 
popu.lbl 
Text label for current population 
cond.true.lbl 
Text label for current cases of 
cond.false.lbl 
Text label for current cases of 
dec.pos.lbl 
Text label for current cases of 
dec.neg.lbl 
Text label for current cases of 
hi.lbl 
Text label for hits 
mi.lbl 
Text label for misses 
fa.lbl 
Text label for false alarms 
cr.lbl 
Text label for correct rejections 
col.txt 
Color for text labels (in boxes). 
box.cex 
Scaling factor for text (in boxes).
Default: 
col.boxes 
Colors of boxes (a single color or a vector with named colors matching the number of current boxes).
Default: Current color information contained in 
col.border 
Color of borders.
Default: 
lwd 
Width of arrows. 
box.lwd 
Width of boxes. 
col.shadow 
Color of box shadows.
Default: 
cex.shadow 
Scaling factor of shadows (values > 0 showing shadows).
Default: 
plot_fnet
is a generalization of plot_tree
and offers the additional option of plotting the interplay
between the 9 frequencies of freq
and
and the 10 probabilities of prob
in a single network diagram.
The option by
(as 2 or 4 characters) allows specifying
4 different ways of arranging frequencies:
"cd"
plots a tree diagram in which the population is split by condition;
"dc"
plots a tree diagram in which the population is split by decision;
"cddc"
plots a network diagram in which the population is split 1st by condition, 2nd by decision (default);
"dccd"
is yet to be implemented.
The option area
(as 2 characters) allows specifying
4 different box shapes and sizes:
"no"
shows all boxes in the same size (default);
"sq"
shows boxes as squares with area sizes proportional to frequencies;
"hr"
shows boxes as horizontal rectangles of area sizes proportional to frequencies;
"vr"
shows boxes as vertical rectangles of area sizes proportional to frequencies.
The resulting shapes and their relative proportions correspond to the areas in plot_mosaic
.
If a prevalence value prev
is provided, a new list of
natural frequencies freq
is computed by comp_freq
.
By contrast, if no prevalence value prev
is provided,
the values currently contained in freq
are used.
By default, comp_freq
rounds frequencies to nearest integers
to avoid decimal values in freq
.
plot_fnet
requires and uses the R package "diagram"
(library("diagram")
).
Nothing (NULL).
num
contains basic numeric parameters;
init_num
initializes basic numeric parameters;
freq
contains current frequency information;
comp_freq
computes current frequency information;
prob
contains current probability information;
comp_prob
computes current probability information;
pal
contains current color settings;
txt
contains current text settings;
comp_min_N
computes a suitable minimum population size N
.
Other visualization functions: plot.riskyr
,
plot_curve
, plot_icons
,
plot_mosaic
, plot_plane
,
plot_tree
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55  # Plotting existing freq:
plot_fnet() # => plot current freq with default options
plot_fnet(by = "dccd")
plot_fnet(area = "no")
plot_fnet(p.lbl = "num")
plot_fnet(title.lbl = "")
plot_fnet(N = 33)
plot_fnet(N = NA)
# Computing and plotting new frequencies from probabilities:
plot_fnet(prev = 1/3) # => changes prev, but uses current defaults of sens and spec
plot_fnet(prev = 1/3, N = 55)
plot_fnet(prev = 1/3, N = NA)
plot_fnet(prev = 1/3, round = FALSE)
plot_fnet(prev = .10, sens = .90, spec = 1/3, N = 100)
plot_fnet(prev = .10, sens = .90, spec = NA, fart = 1/3, N = 33)
plot_fnet(prev = .10, sens = .90, spec = 1/3, fart = NA, N = NA)
plot_fnet(prev = .10, sens = .90, spec = NA, fart = 1/3, N = NA)
# Perspective options:
plot_fnet(by = "cd") # => 1. Tree diagram (by condition)
plot_fnet(by = "dc") # => 2. Tree diagram (by decision)
plot_fnet(by = "cddc") # => 3. Network diagram (1st by cond, 2nd by dec) (default)
plot_fnet(by = "dccd") # => 4. Network diagram (1st by dec, 2nd by cond)
# Area options:
plot_fnet(area = "sq") # => (default)
plot_fnet(area = "no")
plot_fnet(area = "sq", round = FALSE)
plot_fnet(area = "hr")
plot_fnet(area = "vr", round = FALSE)
# Accuracy:
plot_fnet(show.accu = TRUE) # => default w = .5 (balanced accuracy "bacc")
plot_fnet(show.accu = TRUE, w.acc = 1/3) # => (weighted accuracy "wacc")
plot_fnet(show.accu = FALSE) # => no accuracy info.
# Rounding:
plot_fnet(prev = .1, sens = .7, spec = .9, N = 10, by = "cddc", area = "sq",
p.lbl = "num", round = TRUE) # => mi = 0
plot_fnet(prev = .1, sens = .7, spec = .9, N = 10, by = "cddc", area = "sq",
p.lbl = "num", round = FALSE) # => mi = 0.3
# Combining perspectives, areas, and label options:
plot_fnet(by = "cd", area = "sq", p.lbl = "nam") # => by cond + sq + prob names
plot_fnet(by = "cd", area = "hr", p.lbl = "num") # => by cond + hr + prob numbers
plot_fnet(by = "dc", area = "sq", p.lbl = "num") # => by dec + sq + mix names and numbers
plot_fnet(by = "dc", area = "vr", p.lbl = "mix") # => by dec + vr + min. labels
# Custom colors and shadows:
plot_fnet(prev = .08, sens = .92, spec = .95, N = 10000, area = "hr")
plot_fnet(area = "sq", col.boxes = "gold", col.border = "steelblue4",
col.shadow = "steelblue4", cex.shadow = .008)
plot_fnet(N = NA, area = "vr", col.txt = "steelblue4", col.boxes = "lightyellow",
col.border = grey(.3, .7), cex.shadow = .008, col.shadow = grey(.1, .9))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.