unscale: Miscellaneous Utilities

View source: R/Misc.R

unscaleR Documentation

Miscellaneous Utilities

Description

Utilities.

Usage

unscale(scaledx,ctrs=NULL,sds=NULL)
mmscale(m,scalePars=NULL,p=NULL)
catDFRow(dfRow)
constCols(d)
allNumeric(lst)

Arguments

scaledx

A matrix.

m

A matrix.

ctrs

Take the original means to be ctrs

lst

An R list.

sds

Take the original standard deviations to be sds

dfRow

A row in a data frame.

d

A data frame or matrix.

scalePars

If not NULL, a 2-row matrix, with column i storing the min and max values to be used in scaling column i of m. Typically, one has previously called mmscale on a dataset and saved the resulting scale parameters, and we wish to use those same scale parameters on new data.

p

If m is a vector, this specifies the number of columns it should have as a matrix. The code will try to take care of this by itself if p is left at NULL.

Details

The function mmscale is meant as a better-behaved alternative to scale. Using minimum and maximum values, it maps variables to [0,1], thus avoiding the problems arising from very small standard deviations in scale.

The function catDFRow nicely prints a row of a data frame.

The function constCols determines which columns of a data frame or matrix are constant, if any.

Value

The function unscale returns the original object to which scale had been applied. Or, the attributes ctrs and sds can be specified by the user.

Author(s)

Norm Matloff


matloff/regtools documentation built on Oct. 23, 2024, 2:58 a.m.