Displaying 3 results from an estimated 3 matches for "statement_2".
Did you mean:
statement2
2008 Jan 13
4
For Loop performance
...e you can help .
I have two vector V1 and V2, where length(V2) = length of (V1) * 2;
length(V1) ~ 16,000.
For each member in V1, I need to compare 2 element of V2 for equality
i.e.
for (I in 1:length (V1)) {
if ( v2[i] == v1[i] & v2[i+1]==v1[i] ){
statement_1
statement_2
.
}
}
This for-loop is too slow (it takes a good 5 minutes on my Windows machine)
to finish processing the vector V1 of 16,000; I will need to process a lot
more than 16,000 (about 300*16,000).
Is there a better way to do looping with R? Any help is greatly appreciate...
2009 May 04
1
wrong if-else syntax
What is wrong in the following nested if-else statements:
if (Condition_1) { # begin IF_1
statement_1
statement_2
statement_3
if (Condition_2) { # begin IF_2
a<- a +1
} # end IF_2
statement_4
statement_5
statement_6
statement_7
if (Condition_3) { # begin IF_2...
2009 May 05
1
self organizing map advice for categorical data
...t stats.uwo.ca>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 04/05/2009 5:08 AM, mauede at alice.it wrote:
> What is wrong in the following nested if-else statements:
>
> if (Condition_1) { # begin IF_1
> statement_1
> statement_2
> statement_3
> if (Condition_2) { # begin IF_2
> a<- a +1
> } # end IF_2
> statement_4
> statement_5
> statement_6
> statement_7
> if (Condition_3) {...