R version 4.5.0 RC (2025-04-04 r88113 ucrt) -- "How About a Twenty-Six" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(Thresher) Loading required package: ClassDiscovery Loading required package: cluster Loading required package: oompaBase Loading required package: PCDimension > > # unstructured matrix > suppressWarnings( RNGversion("3.5.0") ) > set.seed(9948489) > dumb <- matrix(rnorm(100*12), ncol=12) > colnames(dumb) <- paste("G", 1:12, sep='') > thresh <- Thresher(dumb) > # test 'failure' version of constructor > r <- new("Reaper", thresh, + useLoadings=FALSE, + keep=FALSE, + nGroups=NA, + fit=NA, + bic=NA, + allfits=list(), + metric='pearson') > r@nGroups [1] NA > # now construct it for real > reap <- Reaper(thresh) > reap@nGroups [1] 2 > screeplot(reap) > plot(reap) > scatter(reap) > heat(reap) > > # matrices with structure > set.seed(250264) > load(system.file("Examples/thresh.Rda", package="Thresher")) > thresh@nSample # 300 [1] 300 > thresh@rho # 0.5 [1] 0.5 > thresh@pcdim # 2 [1] 2 > min(thresh@delta) > 0.5 # TRUE [1] TRUE > round(det(thresh@covariance), 5) # 0.00117 [1] 0.00117 > # create Reaper > reap <- Reaper(thresh) > reap@pcdim # two real components [1] 2 > reap@nGroups # and two clusters [1] 2 > reap@bic # check the BIC levels NC=2 NC=3 NC=4 NC=5 -2563.702 2476.929 3308.706 4140.482 > screeplot(reap, col='gold', lcol='black') > plot(reap) > scatter(reap) > heat(reap) > > colsch <- Thresher:::.makeColorScheme(4) > bin.hc <- reap@signalSet@binaryClusters > bin.csc <- colsch[cutree(bin.hc, k=4)] > con.hc <- reap@signalSet@continuousClusters > con.csc <- colsch[cutree(con.hc, k=4)] > heat(reap, Colv=as.dendrogram(bin.hc), ColSideColors=con.csc, + main=paste(reap@name, "binary signals, cont. colors")) > heat(reap, Colv=as.dendrogram(con.hc), ColSideColors=bin.csc, + main=paste(reap@name, "cont. signals, binary colors")) > > if(FALSE) { + makeFigures(reap) + } > > proc.time() user system elapsed 1.90 0.18 2.03