[R] Big data and column correspondence problem

Petr PIKAL petr.pikal at precheza.cz
Tue Jul 26 16:49:42 CEST 2011


Hi

> Re: [R] Big data and column correspondence problem
> 
> Daniel, thanks for the answer.
> I will try to make myself i little bit clearer. Doing step by step I 
would
> have (using a loop trough the lines of 'A'):

I am not sure if you are successful in your clarifying.

> 
> 1. AA[1] is 4. As so, I would have to compare A1[1] = 20 and A2[1] =3 
with

I can not see A1[1]=20 in your example data.

> A[1,]
AA A1 A2 
 4  3  3 

gives me this.


> 
>            B1 B2 B3
> B[3,2:4] 7 11 NA

Why B[3,]? 

> 
> beacause BB[3]=4. Since there is no match, this would retrieve me a 
zero.
> The same would happen with AA[2]. For AA[3] I have 
> 
>      AA A1 A2
> [3,]  4 11  7
> 
> Since  both A1[3] = 20 and A2[3] =3 match with B[3,2:4] this would 
retrieve
> me 1.

In what sense those two lines match?
A[3,]
AA A1 A2 
 4  5  5 
B[3,]
BB B1 B2 B3 
 4  7 11 NA 

I must say I am completely lost.

Maybe you could try to present a code with your toy data which give 
desired result but is too slow with original data.

Regards
Petr


> 
> 2. For AA[4:5] i would have to compare each line with B[1:2,2:4]. That 
is,
> for AA[4]=2 i have a match with BB[1] and BB[2]. Then I have to compare
> 
>       A1 A2
> [4,]  5  5
> 
> with 
> 
>            B1 B2 B3
> B[1,2:4] 5  3  12
> 
> and
> 
>             B1 B2 B3
> B[2,2:4] 11 12 13
> 
> Again, for A1[4] and A2[4] and would have no match. But A1[5] and A1[5]
> match with B2[1] and B1[1].
> 
> 3. And so on for the other lines of A.
> 
> The problem is that if I perform that as a loop it really takes to long.
> Hope i could make it clearer.
> 
> --
> View this message in context: 
http://r.789695.n4.nabble.com/Big-data-and-
> column-correspondence-problem-tp3694912p3695795.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list