-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# RcppDend | ||
|
||
## Introduction | ||
|
||
A dendrogram object in R are is a list structure with attributes in its | ||
nodes and leaves. | ||
|
||
## Motivation | ||
|
||
Working with dendrogram objects often require a function | ||
to recursively go through all (or most) element in the list object. | ||
Naturally, such function are rather slow in R, but can become much faster | ||
thank to Rcpp. | ||
|
||
This package offers faster manipulation of dendrogram objects in | ||
R. | ||
|
||
## Installation | ||
|
||
To install the stable version on CRAN: | ||
|
||
```r | ||
# install.packages('RcppDend') # not yet available from CRAN | ||
``` | ||
|
||
To install the GitHub version: | ||
|
||
```r | ||
if (!require('devtools')) install.packages('devtools'); require('devtools') | ||
install_github('RcppDend', 'talgalili') | ||
``` | ||
|
||
## Usage | ||
|
||
```r | ||
library(RcppDend) | ||
|
||
hc <- hclust(dist(USArrests)) | ||
dend <- as.dendrogram(hc) | ||
|
||
labels(dend) | ||
|
||
require(microbenchmark) | ||
microbenchmark(stats:::labels.dendrogram(dend), | ||
RcppDend:::labels.dendrogram(dend), | ||
times = 100) | ||
# about 30 times faster. It is faster the larger the tree is. | ||
|
||
``` | ||
|
||
## Contact | ||
|
||
You are welcome to: | ||
* submit suggestions and bug-reports at: <https://github.com/talgalili/RcppDend/issues> | ||
* send a pull request on: <https://github.com/talgalili/RcppDend/> | ||
* compose a friendly e-mail to: <tal.galili@math.tau.ac.il> | ||
|
||
|
||
## Available functions | ||
|
||
* labels.dendrogram (or simply labels) | ||
|
||
|
||
## MORE INFORMATION | ||
|
||
Visit the Rcpp project! | ||
|
||
* http://www.rcpp.org/ | ||
* http://gallery.rcpp.org/ | ||
* http://cran.r-project.org/web/packages/Rcpp/index.html | ||
* http://dirk.eddelbuettel.com/code/rcpp.html | ||
* http://blog.r-enthusiasts.com/tag/rcpp/ | ||
|