Skip to contents



Description

Set of R functions for the development of R functions, written according to the safer project specifications.


Content


Function Description
mat_fill() Detect the empty half part of a symmetric square matrix (either topleft, topright, bottomleft or bottomright). Fill this empty half part using the other symmetric half part of the matrix.
mat_inv() Return the inverse of a square matrix when solve() cannot.
mat_num2color() Convert a matrix made of numbers into a hexadecimal matrix for rgb colorization.
mat_op() Assemble several matrices of same dimensions by performing by case operation. For instance, with kind.of.operation = “+”, the function will add the value of all the case 1 (row1 & column1) of the matrices and put it in the case 1 of a new matrix M, according to the formula cij=k=1k=zcijkc_{ij} = \sum_{k=1}^{k=z} c_{ijk} where c: case, i: row number, j: column number, k: matrix number and z: number of matrices
mat_rotate() 90° clockwise matrix rotation. Applied twice, the function provide the mirror matrix, according to vertical and horizontal symmetry.


Read vignette("saferMatrix") for more details.


Versions

The different saferMatrix releases are tagged here.


Installation

saferMatrix can be currently be installed from GitHub:

install.packages("remotes")
remotes::install_github("https://github.com/safer-r/saferMatrix") # or open R as admin and remotes::install_github("https://github.com/safer-r/saferMatrix", lib = "C:/Program Files/R/R-4.3.1/library")

Older versions can be installed like this:

v <- "v1.0" # desired tag version
remotes::install_github(paste0("https://github.com/safer-r/saferMatrix/tree/", v))


Licence

This package can be redistributed and/or modified under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchandability or fitness for a particular purpose. See the GNU General Public License for more details at https://www.gnu.org/licenses or in the Licence.txt attached file.


Citation

If you are using functions of saferMatrix, please cite:

Wang H, Han Y, Serizay J, Millot GA (2023). The R saferMatrix package. https://github.com/safer-r/saferMatrix/.


Credits

Haiding Wang, Bioinformatics and Biostatistics Hub, Institut Pasteur, Paris, France

Yushi Han, Bioinformatics and Biostatistics Hub, Institut Pasteur, Paris, France

Jacques Serizai, Spatial Regulation of Genomes team, Institut Pasteur, Paris, France

Gael A. Millot, Bioinformatics and Biostatistics Hub, Institut Pasteur, Paris, France


Acknowledgements

The developers & maintainers of the mentioned softwares and packages, including: