Skip to content

Instantly share code, notes, and snippets.

@lgatto
Last active September 1, 2016 16:09
Show Gist options
  • Save lgatto/c9ee62d63828b875bc8208389d57ac24 to your computer and use it in GitHub Desktop.
Save lgatto/c9ee62d63828b875bc8208389d57ac24 to your computer and use it in GitHub Desktop.
BHC projections on PCA plot
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)
}
@lgatto
Copy link
Author

lgatto commented Sep 1, 2016

rplot001

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