You can convert to a numeric matrix to make the operations faster:
>
> x=data.frame(id=rep(sample(1:10,size=1),2),a=sample(c(NA,rnorm(10,0,1)),size=2,
+ replace=T),b=sample(c(NA,rnorm(10,0,1)),size=2,
+ replace=T),c=sample(c(NA,rnorm(10,0,1)),size=2, replace=T))
> x$id=factor
Eleni,
A way to do this is to group the data first using 'split' and then sapply
the dist function to this list.
The slower step will be the split which took a couple of minutes on my
laptop but sapply should not take more than a minute or so.
size <- 1
df <- data.frame(
id=rep(sample
2 matches
Mail list logo