R Under development (unstable) (2024-04-27 r86487 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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(ClassDiscovery) Loading required package: cluster Loading required package: oompaBase > suppressWarnings( RNGversion("3.5.3") ) > set.seed(581492) > # simulate data from three groups > d1 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE) > d2 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE) > d3 <- matrix(rnorm(100*10, rnorm(100, 0.5)), nrow=100, ncol=10, byrow=FALSE) > dd <- cbind(d1, d2, d3) > # colors that match the groups > cols <- rep(c('red', 'green', 'blue'), each=10) > > # compute teh PCanova object > pan <- PCanova(dd, c('red', 'green', 'blue'), cols, cols) > summary(pan) An object of the PCanova class with 3 groups. Call: PCanova(data = dd, classes = c("red", "green", "blue"), labels = cols, colors = cols) > > # view the PC plots > plot(pan) > > # view the dendrograms > pltree(pan, line=-0.5) > > # compare teh results when there is no underlying group structure > dd <- matrix(rnorm(100*50, rnorm(100, 0.5)), nrow=100, ncol=50, byrow=FALSE) > cols <- rep(c('red', 'green', 'blue', 'orange', 'cyan'), each=10) > pan <- PCanova(dd, unique(cols), cols, cols) > plot(pan, mscale=1/sqrt(10)) > > pltree(pan, line=-0.5) > > # cleanup > rm(d1, d2, d3, dd, cols, pan) > > proc.time() user system elapsed 0.34 0.03 0.37