Skip to content

Instantly share code, notes, and snippets.

@seabbs
Created April 12, 2018 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seabbs/7f68509cb710eac6eab91bdca0ea47ed to your computer and use it in GitHub Desktop.
Save seabbs/7f68509cb710eac6eab91bdca0ea47ed to your computer and use it in GitHub Desktop.
Sample code for thresher
#' Load the package
library(Thresher)
#' Generate random data
set.seed(3928270)
ranData <- matrix(rnorm(100*12), ncol=12)
colnames(ranData) <- paste("G", 1:12, sep='')
#' Perform dim reduction
thresh1 <- Thresher(ranData)
#' Outlier removal and clustering
reap1 <- Reaper(thresh1)
#' Noise features
colnames(ranData)[!reap1@keep]
#' Plot remaining features projected onto PC space
plot(reap1)
#' Optimal number of groups
reap1@nGroups
#' Heat map of data using only the good features
heat(reap1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment