scale(base)
scale()所属R语言包:base
Scaling and Centering of Matrix-like Objects
缩放和中心矩阵状物体
译者:生物统计家园网 机器人LoveR
描述----------Description----------
scale is generic function whose default method centers and/or scales the columns of a numeric matrix.
scale是通用的功能,其默认方法中心和/或尺度数值矩阵的列。
用法----------Usage----------
scale(x, center = TRUE, scale = TRUE)
参数----------Arguments----------
参数:x
a numeric matrix(like object).
数字矩阵(如对象)。
参数:center
either a logical value or a numeric vector of length equal to the number of columns of x.
无论是逻辑值或数值向量的长度等于x列数。
参数:scale
either a logical value or a numeric vector of length equal to the number of columns of x.
无论是逻辑值或数值向量的长度等于x列数。
Details
详情----------Details----------
The value of center determines how column centering is performed. If center is a numeric vector with length equal to the number of columns of x, then each column of x has the corresponding value from center subtracted from it. If center is TRUE then centering is done by subtracting the column means (omitting NAs) of x from their corresponding columns, and if center is FALSE, no centering is done.
center价值决定如何进行列居中。如果center是一个长度等于列数的数字矢量x,然后每列x从center从中减去相应的值。如果center是TRUE然后定心减去列方式(省略NAS)x从他们的相应列,如果center FALSE,没有定心。
The value of scale determines how column scaling is performed (after centering). If scale is a numeric vector with length equal to the number of columns of x, then each column of x is divided by the corresponding value from scale. If scale is TRUE then scaling is done by dividing the (centered) columns of x by their standard deviations if center is TRUE, and the root mean square otherwise. If scale is FALSE, no scaling is done.
scale价值决定如何执行列缩放(后定心)。如果scale是一个长度等于列数的数字矢量x,然后每列x划分由相应的值从scale。 scale如果是TRUE然后除以(中心)列缩放xcenter其标准偏差如果TRUE,根的意思正视,否则。如果scaleFALSE做,不结垢。
The root-mean-square for a (possibly centered) column is defined as sqrt(sum(x^2)/(n-1)), where x is a vector of the non-missing values and n is the number of non-missing values. In the case center=TRUE, this is the same as the standard deviation, but in general it is not. (To scale by the standard deviations without centering, use scale(x,center=FALSE,scale=apply(x,2,sd,na.rm=TRUE)).)
(可能居中)列根均方被定义为sqrt(sum(x^2)/(n-1)),其中x是一个非缺失值的向量和n是一些非缺失值。的情况下center=TRUE,这是相同的标准偏差,但它不是一般。 (无定心的标准偏差要缩放,使用scale(x,center=FALSE,scale=apply(x,2,sd,na.rm=TRUE))。)
值----------Value----------
For scale.default, the centered, scaled matrix. The numeric centering and scalings used (if any) are returned as attributes "scaled:center" and "scaled:scale"
scale.default,中心,缩放矩阵。数字定心和使用(如有)结垢返回属性"scaled:center"和"scaled:scale"
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
sweep which allows centering (and scaling) with arbitrary statistics.
sweep这允许任意统计中心(缩放)。
For working with the scale of a plot, see par.
对于工作与图的规模,看到par。
举例----------Examples----------
require(stats)
x <- matrix(1:10, ncol=2)
(centered.x <- scale(x, scale=FALSE))
cov(centered.scaled.x <- scale(x))# all 1[所有1]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|