Debian Codegraph @

man/duplicate_leaf.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/sample.dendrogram.R
3 \name{duplicate_leaf}
4 \alias{duplicate_leaf}
5 \title{Duplicate a leaf X times}
6 \usage{
7 duplicate_leaf(
8 dend,
9 leaf_label,
10 times,
11 fix_members = TRUE,
12 fix_order = TRUE,
13 fix_midpoint = TRUE,
14 ...
15 )
16 }
17 \arguments{
18 \item{dend}{a dendrogram object}
19
20 \item{leaf_label}{the label of the laef to replicate.}
21
22 \item{times}{the number of times we will have this leaf after replication}
23
24 \item{fix_members}{logical (TRUE). Fix the number of members in attr
25 using \link{fix_members_attr.dendrogram}}
26
27 \item{fix_order}{logical (TRUE). Fix the leaves order}
28
29 \item{fix_midpoint}{logical (TRUE). Fix the midpoint value.
30 If TRUE, it overrides "fix_members" and turns it into TRUE (since it must
31 have a correct number of members in order to work).
32 values using \link{rank_order.dendrogram}}
33
34 \item{...}{not used}
35 }
36 \value{
37 A dendrogram, after duplicating one of its leaves.
38 }
39 \description{
40 Duplicates a leaf in a tree. Useful for non-parametric bootstraping trees
41 since it emulates what would have happened if the tree was constructed based
42 on a row-sample with replacments from the original data matrix.
43 }
44 \examples{
45
46 \dontrun{
47 # define dendrogram object to play with:
48 dend <- USArrests[1:3, ] \%>\%
49 dist() \%>\%
50 hclust(method = "ave") \%>\%
51 as.dendrogram()
52 plot(dend)
53 duplicate_leaf(dend, "Alaska", 3)
54 duplicate_leaf(dend, "Arizona", 2, fix_members = FALSE, fix_order = FALSE)
55 plot(duplicate_leaf(dend, "Alaska", 2))
56 plot(duplicate_leaf(dend, "Alaska", 4))
57 plot(duplicate_leaf(dend, "Arizona", 2))
58 plot(duplicate_leaf(dend, "Arizona", 4))
59 }
60
61 }