Debian Codegraph @

man/assign_values_to_branches_edgePar.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/attr_access.R
3 \name{assign_values_to_branches_edgePar}
4 \alias{assign_values_to_branches_edgePar}
5 \title{Assign values to edgePar of dendrogram's branches}
6 \usage{
7 assign_values_to_branches_edgePar(
8 dend,
9 value,
10 edgePar,
11 skip_leaves = FALSE,
12 warn = dendextend_options("warn"),
13 ...
14 )
15 }
16 \arguments{
17 \item{dend}{a dendrogram object}
18
19 \item{value}{a new value scalar for the edgePar attribute.}
20
21 \item{edgePar}{a character indicating the value inside edgePar to adjust.
22 Can be either "col", "lty", or "lwd".}
23
24 \item{skip_leaves}{logical (FALSE) - should the leaves be skipped/ignored?}
25
26 \item{warn}{logical (default from dendextend_options("warn") is FALSE).
27 Set if warning are to be issued, it is safer to keep this at TRUE,
28 but for keeping the noise down, the default is FALSE.}
29
30 \item{...}{not used}
31 }
32 \value{
33 A dendrogram, after adjusting the edgePar attribute in all of its branches,
34 }
35 \description{
36 Go through the dendrogram branches and updates the values inside its edgePar
37
38 If the value has Inf then the value in edgePar will not be changed.
39 }
40 \examples{
41
42 # This failed before - now it works fine. (thanks to Martin Maechler)
43 dend <- 1:2 \%>\%
44 dist() \%>\%
45 hclust() \%>\%
46 as.dendrogram()
47 dend \%>\%
48 set("branches_lty", 1:2) \%>\%
49 set("branches_col", c("topbranch_never_plots", "black", "orange")) \%>\%
50 plot()
51 \dontrun{
52
53 dend <- USArrests[1:5, ] \%>\%
54 dist() \%>\%
55 hclust() \%>\%
56 as.dendrogram()
57 plot(dend)
58 dend <- assign_values_to_branches_edgePar(dend = dend, value = 2, edgePar = "lwd")
59 plot(dend)
60 dend <- assign_values_to_branches_edgePar(dend = dend, value = 2, edgePar = "col")
61 plot(dend)
62 dend <- assign_values_to_branches_edgePar(dend = dend, value = "orange", edgePar = "col")
63 plot(dend)
64 dend2 <- assign_values_to_branches_edgePar(dend = dend, value = 2, edgePar = "lty")
65 plot(dend2)
66
67 dend2 \%>\%
68 unclass() \%>\%
69 str()
70 }
71
72 }
73 \seealso{
74 \link{get_root_branches_attr}
75 }