MyNixOS website logo
Description

Construct Reactive Calibrated Axes Biplots.

A modern view on the principal component analysis biplot with calibrated axes. Create principal component analysis biplots rendered in HTML with significant reactivity embedded within the plot. Furthermore, the traditional biplot view is enhanced by translated axes with inter-class kernel densities superimposed. For more information on biplots, see Gower, J.C., Lubbe, S. and le Roux, N.J. (2011, ISBN: 978-0-470-01255-0).

bipl5

The goal of bipl5 is to provide a modern take on PCA biplots with calibrated axes. The biplots are rendered in HTML via the plotly graphing library, upon which custom JavaScript code is appended to make the plot reactive. The traditional biplot view is also extended through an algorithm that translates the axes out of the data centroid, decluttering the view. In addition to the former, inter-class kernel densities are superimposed on the axes to give an indication of the data spread across the variables.

Installation

You can install the latest version of bipl5 from CRAN with:

install.packages("bipl5")
library(bipl5)
#> 
#> Welcome to bipl5!
#> 
#> Run help(bipl5) for more information on the package scope.

Example: Traditional PCA biplot

This is a basic example of constructing a traditional PCA biplot with calibrated axes and vector loadings. In the literature, a square is often drawn around the biplot purely for aesthetic reasons. This approached was modified by constructing a circle which bounds the plot:

PCAbiplot(iris[,-5],group=iris[,5])
#> Call:
#> PCAbiplot(x = iris[, -5], group = iris[, 5])
#> 
#> Data Breakdown:
#>   n: 150 
#>   p: 4
#> 
#> Grouping variable:            
#>              Count
#>   setosa        50
#>   versicolor    50
#>   virginica     50
#> 
#> Fit Statistics:
#> 
#> 
#> Table: Adequacy of the Axes
#> 
#> |         | Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|
#> |:--------|------------:|-----------:|------------:|-----------:|
#> |PC: 1+2: |       0.4140|      0.9250|       0.3375|      0.3235|
#> |PC: 1+3: |       0.7893|      0.1323|       0.3571|      0.7214|
#> |PC: 2+3: |       0.6602|      0.9122|       0.0208|      0.4068|
#> 
#> 
#> Table: Axis Predictivity
#> 
#> |         | Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|
#> |:--------|------------:|-----------:|------------:|-----------:|
#> |PC: 1+2: |       0.9226|      0.9909|       0.9837|      0.9353|
#> |PC: 1+3: |       0.8684|      0.2205|       0.9861|      0.9902|
#> |PC: 2+3: |       0.2062|      0.7880|       0.0035|      0.0631|
#> 
#> Quality of display = 95.81% = 72.96% (PC1) + 22.85% (PC2)

On the rendered HTML file there are reactive events embedded on the plot, such as changing the principal components used for the scaffolding. More detailed information can be obtained by reading the help documentation

?PCAbiplot

Example: Automated Orthogonal Parallel Translation of the axes

The cluttering in the centroid of the biplot can be relieved by the Orthogonal Parallel Translation of the axes out of the data centroid in such a way that the correlation structure among variables is retained. This is done with the following:

x<-PCAbiplot(iris[,-5],group=iris[,5])
x |> TDAbiplot()
#> [1] 1.008636
#> Call:
#> PCAbiplot(x = iris[, -5], group = iris[, 5]) |> 
#>  TDAbiplot.bipl5(x = x)
#> 
#> Data Breakdown:
#>   n: 150 
#>   p: 4
#> 
#> Grouping variable:            
#>              Count
#>   setosa        50
#>   versicolor    50
#>   virginica     50
#> 
#> Fit Statistics:
#> 
#> 
#> Table: Adequacy of the Axes
#> 
#> |         | Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|
#> |:--------|------------:|-----------:|------------:|-----------:|
#> |PC: 1+2: |       0.4140|      0.9250|       0.3375|      0.3235|
#> |PC: 1+3: |       0.7893|      0.1323|       0.3571|      0.7214|
#> |PC: 2+3: |       0.6602|      0.9122|       0.0208|      0.4068|
#> 
#> 
#> Table: Axis Predictivity
#> 
#> |         | Sepal.Length| Sepal.Width| Petal.Length| Petal.Width|
#> |:--------|------------:|-----------:|------------:|-----------:|
#> |PC: 1+2: |       0.9226|      0.9909|       0.9837|      0.9353|
#> |PC: 1+3: |       0.8684|      0.2205|       0.9861|      0.9902|
#> |PC: 2+3: |       0.2062|      0.7880|       0.0035|      0.0631|
#> 
#> Quality of display = 95.81% = 72.96% (PC1) + 22.85% (PC2)
Metadata

Version

1.0.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows