set_X_attributes: sets three attributes for matrix X

View source: R/set_X_attributes.R

set_X_attributesR Documentation

sets three attributes for matrix X

Description

sets three attributes for matrix X

Usage

set_X_attributes(X, center = TRUE, scale = TRUE, LD = NULL)

Arguments

X

an N by P data matrix that can be either a trend filtering matrix or a regular dense/sparse matrix

center

boolean indicating centered by column means or not

scale

boolean indicating scaled by column standard deviations or not

Value

X with three attributes e.g. attr(X, 'scaled:center') is a p vector of column means of X if center=TRUE, a p vector of 0s otherwise. attr(X, 'scaled:scale') is a p vector of column standard deviations of X if scale=TRUE, a p vector of 1s otherwise. attr(X, 'd') is a p vector of column sums of X.standardized^2, where X.standardized is the matrix X centered by attr(X, 'scaled:center') and scaled by attr(X, 'scaled:scale'). attr(X, 'scaledX') returns the transformed X matrix after mean and standard deviation adjustment of its columns. attr(X, 'LD') returns the correlation or the LD matrix of the P variables of the matrix X.


kkdey/fineboostR documentation built on Jan. 1, 2023, 4:48 p.m.