| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/rotate.R |
| 3 |
\name{click_rotate} |
| 4 |
\alias{click_rotate} |
| 5 |
\alias{click_rotate.default} |
| 6 |
\alias{click_rotate.dendrogram} |
| 7 |
\title{Interactively rotate a tree object} |
| 8 |
\usage{ |
| 9 |
click_rotate(x, ...) |
| 10 |
|
| 11 |
\method{click_rotate}{default}(x, ...) |
| 12 |
|
| 13 |
\method{click_rotate}{dendrogram}( |
| 14 |
x, |
| 15 |
plot = TRUE, |
| 16 |
plot_after = plot, |
| 17 |
horiz = FALSE, |
| 18 |
continue = FALSE, |
| 19 |
... |
| 20 |
) |
| 21 |
} |
| 22 |
\arguments{ |
| 23 |
\item{x}{a tree object (either a \code{dendrogram} or \code{hclust})} |
| 24 |
|
| 25 |
\item{...}{parameters passed to the plot} |
| 26 |
|
| 27 |
\item{plot}{(logical) should the dendrogram first be plotted.} |
| 28 |
|
| 29 |
\item{plot_after}{(logical) should the dendrogram be plotted after |
| 30 |
the rotation?} |
| 31 |
|
| 32 |
\item{horiz}{logical. Should the plot be normal or horizontal?} |
| 33 |
|
| 34 |
\item{continue}{logical. If TRUE, allows the user to keep |
| 35 |
clicking the plot until a click is made on the labels.} |
| 36 |
} |
| 37 |
\value{ |
| 38 |
A rotated tree object |
| 39 |
} |
| 40 |
\description{ |
| 41 |
Lets te user click a plot of dendrogram |
| 42 |
and rotates the tree based on the location of the click. |
| 43 |
|
| 44 |
Code for mouse selection of (sub-)cluster to be rotated |
| 45 |
} |
| 46 |
\examples{ |
| 47 |
# create the dend: |
| 48 |
dend <- USArrests \%>\% |
| 49 |
dist() \%>\% |
| 50 |
hclust("ave") \%>\% |
| 51 |
as.dendrogram() \%>\% |
| 52 |
color_labels() |
| 53 |
\dontrun{ |
| 54 |
# play with the rotation once |
| 55 |
dend <- click_rotate(dend) |
| 56 |
dend <- click_rotate(dend, horiz = TRUE) |
| 57 |
# keep playing with the rotation: |
| 58 |
while (TRUE) dend <- click_rotate(dend) |
| 59 |
# the same as |
| 60 |
dend <- click_rotate(dend, continue = TRUE) |
| 61 |
} |
| 62 |
|
| 63 |
} |
| 64 |
\seealso{ |
| 65 |
\code{\link{rotate.dendrogram}} |
| 66 |
} |
| 67 |
\author{ |
| 68 |
Andrej-Nikolai Spiess, Tal Galili |
| 69 |
} |