__
From: eliza botto
To: "smartpink...@yahoo.com"
Sent: Tuesday, November 27, 2012 1:53 PM
Subject: RE: [R] loop command to matrix
thanks arun. i m more interested in learning commands.
thankyou so much
eliza
> Date: Tue, 27 Nov 2012 10:45:37 -0800
> From: smartpink...@ya
HI,
May be this helps you:
set.seed(5)
mat1<-matrix(sample(1:400,80,replace=TRUE),ncol=8,nrow=10)
split(mat1,col(mat1))
t(do.call(rbind,lapply(lapply(split(mat1,col(mat1)),function(x)
cbind(matrix(x,ncol=1),mat1)),function(x){
res1<-rowMeans(t(apply(x,1,function(x)
x[!(duplicated(x)|duplicated(
thanks rui!! how can it be that you advise something and it doesn't work :)
eliza
> Date: Tue, 27 Nov 2012 18:14:41 +
> From: ruipbarra...@sapo.pt
> To: eliza_bo...@hotmail.com
> CC: r-help@r-project.org
> Subject: Re: [R] loop command to matrix
>
> Hello,
>
Hello,
Try
x <- matrix(1:18, ncol = 6)
sapply(seq_len(ncol(x)), function(i) x[, i] - rowMeans(x[, -i]))
Hope this helps,
Rui Barradas
Em 27-11-2012 17:51, eliza botto escreveu:
Dear UseRs,Extremely sorry for a basic question. I have a matrix of 19 rows and 365
columns. what i want to do is
4 matches
Mail list logo