Displaying 1 result from an estimated 1 matches for "colxi".
Did you mean:
coli
2011 Apr 07
1
transform() on selective names. Is it possible?
Hi all,
I am whitening my data:
# code begins
N <- 300
M <- 2
x <- matrix(data=rnorm(N*M, 0, 3)-10, ncol=M, nrow=N)
y <- matrix(c(1,-2,-2,1), ncol=M, nrow=M)
z <- data.frame(x %*% y)
colnames(z) <- c('x','y')
par(mfrow=c(1,3))
plot(z, pch=5, col="blue")
whiten <- function(x) { (x-mean(x))/sd(x) }
zz <- transform(z, x=whiten(x), y=whiten(y))