Re: [R] converting manual command to loop command

2012-12-11 Thread Sarah Goslee
it worked... > what if i want traditional distance matrices instead of distance column > vectors?? > i hope i'm not bothering you... > thanks in advance > eliza > > >> Date: Tue, 11 Dec 2012 09:57:37 -0500 >> Subject: Re: [R] converting manual command to loo

Re: [R] converting manual command to loop command

2012-12-11 Thread eliza botto
Dear Sarah, thankyou very much it worked... what if i want traditional distance matrices instead of distance column vectors?? i hope i'm not bothering you... thanks in advance eliza > Date: Tue, 11 Dec 2012 09:57:37 -0500 > Subject: Re: [R] converting manual command to loop com

Re: [R] converting manual command to loop command

2012-12-11 Thread Sarah Goslee
Does this solve your problem: fakedata <- matrix(runif(100), ncol=10) fakedata.dist <- apply(fakedata, 2, function(x)as.vector(dist(x, upper=TRUE, diag=TRUE))) The columns of the resulting matrix contain the distance vectors. Sarah On Tue, Dec 11, 2012 at 9:45 AM, eliza botto wrote: > > Dear