DoubleCenter: Construct and use DoubleCenter transformations

View source: R/DoubleCenter.R

DoubleCenterR Documentation

Construct and use DoubleCenter transformations

Description

A convenience function to create DoubleCenter S4 objects, which are useful for simultaneously row and column centering a matrix.

Usage

DoubleCenter(A)

## S4 method for signature 'DoubleCenter,sparseMatrix'
transform(iform, A)

## S4 method for signature 'DoubleCenter,sparseLRMatrix'
inverse_transform(iform, A)

## S4 method for signature 'DoubleCenter,vsp_fa'
inverse_transform(iform, A)

Arguments

A

A matrix to transform.

iform

An Invertiform object describing the transformation.

Value

  • DoubleCenter() creates a DoubleCenter object.

  • transform() returns the transformed matrix, typically as a sparseLRMatrix::sparseLRMatrix.

  • inverse_transform() returns the inverse transformed matrix, typically as a sparseLRMatrix::sparseLRMatrix in most cases. When possible reduces the sparseLRMatrix::sparseLRMatrix to a Matrix::sparseMatrix().

Examples


library(igraph)
library(igraphdata)

data("karate", package = "igraphdata")

A <- get.adjacency(karate)

iform <- DoubleCenter(A)

A_tilde <- transform(iform, A)
A_recovered <- inverse_transform(iform, A_tilde)

all.equal(A, A_recovered)


invertiforms documentation built on Nov. 25, 2022, 5:05 p.m.