diff --git a/NAMESPACE b/NAMESPACE index 7f54d80..ca68557 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,3 +1,3 @@ importFrom(RColorBrewer, colorRampPalette) - +export(hclust_color,multi_color_rug) exportPattern("^[^\\.]") diff --git a/R/example.R b/R/example.R new file mode 100644 index 0000000..7339f77 --- /dev/null +++ b/R/example.R @@ -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) diff --git a/Rplot_example.jpeg b/Rplot_example.jpeg new file mode 100644 index 0000000..3ea2fc4 Binary files /dev/null and b/Rplot_example.jpeg differ diff --git a/Rplot_example2.jpeg b/Rplot_example2.jpeg new file mode 100644 index 0000000..e92d517 Binary files /dev/null and b/Rplot_example2.jpeg differ