find a subset of the tree
sub-atctree-method.Rdfind a subset of the tree
Details
The subset method for objects of class atctree uses a focal node and a specification of how many generations to accrue. The focal node is specified by an ATC code at any of the five levels (e.g. i="A01"). The generation is specified by integer j, signed positive for ancestors and negative for descendants.
Examples
h <- atctree(schema="full")
#more useful to use the full tree with this approach
# plot the siblings of C01:
plot(h["C01",0], ATC_text=TRUE, stem_label=TRUE, leaf_label=TRUE)
#> Remember you can hover over nodes to see text
# plot descendents of P01 (as far as grandchildren):
plot(h["P01",-2], stem_label=TRUE, leaf_label=TRUE)
#> Remember you can hover over nodes to see text
# plot descendents of P01 (as far as great grandchildren):
plot(h["P01",-3], stem_label=TRUE, leaf_label=TRUE)
#> Remember you can hover over nodes to see text