Last active
September 1, 2016 16:09
-
-
Save lgatto/c9ee62d63828b875bc8208389d57ac24 to your computer and use it in GitHub Desktop.
BHC projections on PCA plot
This file contains hidden or 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
| f <- "clusteringlopit/dunkley/hc_labels_observations_a.txt" | |
| library("pRolocdata") | |
| library("pRoloc") | |
| data(dunkley2006) | |
| makeFoIs <- function(fn, obj) { | |
| x <- readLines(fn)[-1] ## first is 'x' | |
| i <- grep("---", x) | |
| n <- length(i) | |
| res <- vector("list", length = n) | |
| for (j in 1:(n-1)) | |
| res[[j]] <- FeaturesOfInterest(x[(i[j]+1):(i[j+1]-1)], | |
| paste("Cluster", j)) | |
| res[[n]] <- FeaturesOfInterest(x[(i[n]+1):length(x)], | |
| paste("Cluster", n)) | |
| FoICollection(res) | |
| } | |
| foic <- makeFoIs(f, dunkley2006) | |
| for (i in seq_len(length(foic))) { | |
| .foi <- foi(foic)[[i]] | |
| plot2D(dunkley2006, main = description(.foi)) | |
| highlightOnPlot(dunkley2006, .foi) | |
| scan(n = 1) | |
| } |
Author
lgatto
commented
Sep 1, 2016

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment