File: click_rotate.Rd

package info (click to toggle)
r-cran-dendextend 1.14.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,888 kB
  • sloc: sh: 13; makefile: 2
file content (69 lines) | stat: -rw-r--r-- 1,547 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rotate.R
\name{click_rotate}
\alias{click_rotate}
\alias{click_rotate.default}
\alias{click_rotate.dendrogram}
\title{Interactively rotate a tree object}
\usage{
click_rotate(x, ...)

\method{click_rotate}{default}(x, ...)

\method{click_rotate}{dendrogram}(
  x,
  plot = TRUE,
  plot_after = plot,
  horiz = FALSE,
  continue = FALSE,
  ...
)
}
\arguments{
\item{x}{a tree object (either a \code{dendrogram} or \code{hclust})}

\item{...}{parameters passed to the plot}

\item{plot}{(logical) should the dendrogram first be plotted.}

\item{plot_after}{(logical) should the dendrogram be plotted after
the rotation?}

\item{horiz}{logical. Should the plot be normal or horizontal?}

\item{continue}{logical. If TRUE, allows the user to keep
clicking the plot until a click is made on the labels.}
}
\value{
A rotated tree object
}
\description{
Lets te user click a plot of dendrogram
and rotates the tree based on the location of the click.

Code for mouse selection of (sub-)cluster to be rotated
}
\examples{
# create the dend:
dend <- USArrests \%>\%
  dist() \%>\%
  hclust("ave") \%>\%
  as.dendrogram() \%>\%
  color_labels()
\dontrun{
# play with the rotation once
dend <- click_rotate(dend)
dend <- click_rotate(dend, horiz = TRUE)
# keep playing with the rotation:
while (TRUE) dend <- click_rotate(dend)
# the same as
dend <- click_rotate(dend, continue = TRUE)
}

}
\seealso{
\code{\link{rotate.dendrogram}}
}
\author{
Andrej-Nikolai Spiess, Tal Galili
}