scalefun: Different forms of scaling

Description Usage Arguments Value Author(s) Examples

View source: R/scale.R

Description

Function providing different forms of scaling in disciminant analysis - the resulting data matrix is mean-centered after the scaling. Modelled after functions in the st package.

Usage

1
scalefun(sc.p = c("none", "log", "sqrt", "pareto", "auto"))

Arguments

sc.p

Type of scaling. A pass-through option, performing only mean-centering, is provided by argument "none".

Value

A matrix. The function performs the required scaling, and mean-centers the result.

Author(s)

Ron Wehrens

Examples

1
2
3
X <- gen.data(5, nvar = 9, nsimul = 1)
FUN <- scalefun(sc.p = "pareto")
FUN(X$X[,,1])

Example output

Loading required package: pls

Attaching package: 'pls'

The following object is masked from 'package:stats':

    loadings

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Loading required package: MASS
Loading required package: st
Loading required package: sda
Loading required package: entropy
Loading required package: corpcor
Loading required package: fdrtool
            [,1]        [,2]       [,3]        [,4]       [,5]       [,6]
 [1,] -0.7151077  0.90059638  0.3811341  2.20496195 -0.2864103 -0.2988882
 [2,] -0.1029120  1.09629788 -1.1802798  0.85368305  0.9940638  0.1405401
 [3,] -0.4479368 -0.54914591 -0.8520414 -0.07461857 -1.4048650  0.3687326
 [4,]  0.1524163 -0.32220804 -1.3527794 -0.17789674 -0.1976859  1.0555455
 [5,]  0.8973470 -0.75936340  0.7585215 -0.51311518 -0.6095715 -0.9849293
 [6,]  1.5842804 -1.44875953  0.6574427 -0.33626984  0.5382753 -0.8469229
 [7,]  0.9536210  1.42425646 -0.4328867 -0.45822157  0.3922694  0.9558407
 [8,]  0.9527593 -0.78012059  0.5303697  0.03783033  0.3628817 -0.2449460
 [9,] -1.7048303 -0.06766273 -0.1081214 -1.16394450  1.9613540 -0.5764033
[10,] -1.5696372  0.50610947  1.5986407 -0.37240894 -1.7503116  0.4314309
             [,7]       [,8]        [,9]
 [1,]  1.83859865  0.2828409 -0.32195790
 [2,]  0.08827112 -1.9126086  1.16618440
 [3,] -0.01245605  1.2223011 -0.79113876
 [4,]  0.15386884 -0.6985670  0.67639145
 [5,] -1.62052942  0.3897390 -0.92149641
 [6,]  0.88648159  0.7907572 -0.40653263
 [7,] -0.08233790 -0.5715243  0.02979351
 [8,]  1.24655906 -0.6377939  1.00961238
 [9,] -1.16151670 -0.6087496 -1.26631328
[10,] -1.33693919  1.7436053  0.82545724
attr(,"scaled:center")
[1]  0.7956998  0.2866379  0.2934325  0.3725823  0.5272581  0.0970461 -1.1298863
[8] -0.2220723 -0.2404005
attr(,"scaled:scale")
[1] 1.1179532 0.9423186 0.9509014 0.9255068 1.1025372 0.7101325 1.1314322
[8] 1.0873738 0.8734737

BioMark documentation built on May 2, 2019, 3:01 a.m.

Related to scalefun in BioMark...