Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
importFrom(RColorBrewer, colorRampPalette)

export(hclust_color,multi_color_rug)
exportPattern("^[^\\.]")
38 changes: 38 additions & 0 deletions R/example.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## make some text data
dat <- matrix(c(rnorm(100),
rnorm(100,mean=2),
rnorm(100,sd=2)),ncol=15)
## compute pairwise distances
dd <- dist(t(dat))

## perform hierarchical clustering
hc <-hclust(dd)
plot(hc)

## try the color function
hc$labels <- 1:15
hclust_color(hc,
lab.col=rep(c("green","blue","red"),each=5))


####################
####################

## work with the density function
den <- density(dat)
plot(den)

## try multi_color_rug function
multi_color_rug(den)

## try a sparser example
dat2 <- sample(dat,size=15)
den <- density(dat2)
plot(den)
multi_color_rug(den)


## create some other data -- let's say ages
ages <- abs(runif(300)*dat)*25
plot(y=ages,x=dat,pch=20)
multi_color_rug(den)
Binary file added Rplot_example.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Rplot_example2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.