Re: [R] Equivalent to matlab ".*" operator in R

2014-11-19 Thread Ruima E.
> [2,]6 -3 > [3,] 12 -6 > > I hope this helps. > > Chel Hee Lee > > On 14-11-19 08:22 AM, Ruima E. wrote: >> Hi, >> >> I have this: >> >> y = matrix(cbind(c(0, 0.5, 1),c(0, 0.5, 1)),ncol=2) >> z = matrix(c(12, -6),ncol=2) >>

[R] Equivalent to matlab ".*" operator in R

2014-11-19 Thread Ruima E.
Hi, I have this: y = matrix(cbind(c(0, 0.5, 1),c(0, 0.5, 1)),ncol=2) z = matrix(c(12, -6),ncol=2) In matlab I would do this > y .* x I would get this in matlab > ans 0-0 6-3 12 -6 What is the equivalent in R? Thanks [[alternative HTML version deleted]] __

[R] Preprocessing with Caret package

2014-11-17 Thread Ruima E.
Hi, Please consider the following code library (caret) x=matrix(c(12:131),2) p=preProcess(x, method=c("center","scale")); x.prep=predict(p,x) y.prep=x.prep[60,60] How can I get the value of y (the value from y.pre not centered and not scaled ) using p and y.prep? Thank you! Rui [[alte