Re: [R] assign a cluster based on a variable

2011-06-09 Thread Dominik P.H. Kalisch
Oh, right. Now I see. Thanks for your help. Dominik On Thu, 09 Jun 2011 15:33:43 +0200, Uwe Ligges wrote: > On 09.06.2011 14:31, Dominik P.H. Kalisch wrote: >> Hi Uwe, >> >> thanks for your help. I didn't know that function (mea culpa)... >> With merge() it works what I want to do. >> But I'm st

Re: [R] assign a cluster based on a variable

2011-06-09 Thread Uwe Ligges
On 09.06.2011 14:31, Dominik P.H. Kalisch wrote: Hi Uwe, thanks for your help. I didn't know that function (mea culpa)... With merge() it works what I want to do. But I'm still interessted, for a learning purpose, why the loop didn't work. So here are the str() results: str(cluster) int [

Re: [R] assign a cluster based on a variable

2011-06-09 Thread Dominik P.H. Kalisch
Hi Uwe, thanks for your help. I didn't know that function (mea culpa)... With merge() it works what I want to do. But I'm still interessted, for a learning purpose, why the loop didn't work. So here are the str() results: > str(cluster) int [1:18, 1:2] 12051000 12052000 12053000 12054000 1206000

Re: [R] assign a cluster based on a variable

2011-06-07 Thread Uwe Ligges
On 07.06.2011 16:24, Dominik P.H. Kalisch wrote: Hi, I have two matrices of the following form: cluster (n=18): 12062 1 12063 2 12064 2 12065 3 12066 5 KreisSA (n=2304) 12062 12062 12067 12065 12063 12067 I try to assign the cluster[,2] to KreisSAa by the follwoing loop: n <- nrow(cluster)

[R] assign a cluster based on a variable

2011-06-07 Thread Dominik P.H. Kalisch
Hi, I have two matrices of the following form: cluster (n=18): 12062 1 12063 2 12064 2 12065 3 12066 5 KreisSA (n=2304) 12062 12062 12067 12065 12063 12067 I try to assign the cluster[,2] to KreisSAa by the follwoing loop: n <- nrow(cluster) KreisSAa <- numeric() for(i in 1:n){ KreisSA