Have you considered the following:

> x <- 1:11
> xs <- scale(x)
> xs
           [,1]
[1,] -1.5075567
[2,] -1.2060454
...
[11,]  1.5075567
attr(,"scaled:center")
[1] 6
attr(,"scaled:scale")
[1] 3.316625
> attr(xs, "scaled:center")
[1] 6

hope this helps. spencer graves

[EMAIL PROTECTED] wrote:

Nice!

I noticed that in generated structure it has two attributes attr(,"scaled:center") and attr(,"scaled:scale")
How can I access them ?


R





Giovanni Petris <[EMAIL PROTECTED]>
10/24/2003 02:50 PM
Please respond to Giovanni Petris


To: Ryszard Czerminski/PH/[EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: Re: [R] how to remove NaN columns ?





xs <- lapply(xdata, function(x){(x - mean(x))/sqrt(var(x))})



Incidentally, the function 'scale' does just that.





______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to