plot the tree as a network graph
plot-atctree-method.Rdplot the tree as a network graph
Usage
# S4 method for class 'atctree'
plot(
x,
circle = NULL,
ATC_text = NULL,
leaf_label = NULL,
stem_label = NULL,
text_size = 10,
text_angle = 45,
width = 500,
height = 500,
hover_msg = T
)Arguments
- x
an object of class atctree
- circle
whether or not to arrange graph over a circle
- ATC_text
whether or not to label with ATC textual info
- leaf_label
whether or not leaf nodes will be labelled
- stem_label
whether or not stem nodes will be labelled
- text_size
annotation text size
- text_angle
annotation text angle
- width
graph width
- height
graph height
- hover_msg
whether to remind the user that they can hover over nodes
Details
Each node is labelled with its ATC code, and by hovering the cursor over any node the ATC desciption is displayed. The ATC tree can be displayed as a network in layers or on a circle (with radii corresponding to ATC level). It is evident that a plot the full ATC tree is too cluttered. Some subsetting (link), pruning (link) or cutting (link) of the tree is likely to help visualisation.
Examples
# create an ATC tree and plot the whole thing:
h <- atctree(schema="full")
# you could plot this with plot(h) but it takes a while
# large network so not easy to read
# take cutting above node B ; plot all its descendants:
plot(cutting(h,"B"))
#> Remember you can hover over nodes to see text
# plot siblings of node A03
plot(h["A03",0])
#> Remember you can hover over nodes to see text
# plot node B down to its grandchildren:
plot(h["B",-2])
#> Remember you can hover over nodes to see text
# or use a circular layout
plot(h["B",-2], circle=TRUE, stem_label=TRUE)
#> Remember you can hover over nodes to see text