Debian Codegraph @

man/branches_attr_by_lists.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/branches_attr_by.R
3 \name{branches_attr_by_lists}
4 \alias{branches_attr_by_lists}
5 \title{Change col/lwd/lty of branches from the root down to clusters defined by list of labels of respective members}
6 \usage{
7 branches_attr_by_lists(
8 dend,
9 lists,
10 TF_values = c(2, 1),
11 attr = c("col", "lwd", "lty"),
12 ...
13 )
14 }
15 \arguments{
16 \item{dend}{a dendrogram dend}
17
18 \item{lists}{a list where each element contains the labels of members in selected nodes
19 down to which the branches shall be adapted}
20
21 \item{TF_values}{a two dimensional vector with the TF_values to use in case a branch fulfills the condition (TRUE)
22 and in the case that it does not (FALSE). Defaults are 2/1 for col, lwd and lty.
23 (so it will insert the first value, and will not change all the FALSE cases)}
24
25 \item{attr}{a character with one of the following values: col/lwd/lty}
26
27 \item{...}{ignored.}
28 }
29 \value{
30 A dendrogram with modified branches (col/lwd/lty).
31 }
32 \description{
33 The user supplies a dend, lists, and type of condition (all/any), and TF_values
34 And the function returns a dendrogram with branches col/lwd/lty accordingly
35 }
36 \examples{
37 \dontrun{
38
39 library(dendextend)
40
41 set.seed(23235)
42 ss <- sample(1:150, 10)
43
44 # Getting the dend dend
45 dend <- iris[ss, -5] \%>\%
46 dist() \%>\%
47 hclust() \%>\%
48 as.dendrogram()
49 dend \%>\% plot()
50
51 # define a list of nodes
52 L <- list(c("109", "123", "126", "145"), "29", c("59", "67", "97"))
53 dend \%>\%
54 branches_attr_by_lists(L) \%>\%
55 plot()
56
57 # choose different color, and also change lwd and lty
58 dend \%>\%
59 branches_attr_by_lists(L, TF_value = "blue") \%>\%
60 branches_attr_by_lists(L, attr = "lwd", TF_value = 4) \%>\%
61 branches_attr_by_lists(L, attr = "lty", TF_value = 3) \%>\%
62 plot()
63 }
64 }
65 \seealso{
66 \link{branches_attr_by_labels}
67 }