Skip to content
Prev 32891 / 398513 Next

simple matrix question

Paul Lemmens <P.Lemmens at nici.kun.nl> writes:
No. I think you're missing the point (it gives a 2-vector rather than
a 4x2 matrix, and apply(x,2,mean) is quicker for that). Try

sweep(x,2,apply(x,2,mean),function(x,y)y)