Displaying 4 results from an estimated 4 matches for "5954x899".
2018 Apr 30
3
How to visualise what code is processed within a for loop
...;, array R-help <r-help at r-project.org>
Subject: Re: [R] How to visualise what code is processed within a for loop
Hi Rui
Thank you for your suggestion,
I have tested the code suggested by you against that supplied by Don in terms of timing and results are very much aligned: to populate a 5954x899 0/1 matrix on my machine your procedure took 79 secs, while the one with ifelse employed 80 secs, hence unfortunately not really any significant time saved there.
Nevertheless thank you for your contribution.
Kind regards,
Luca
2018-04-28 23:18 GMT+02:00 Rui Barradas <ruipbarradas at sapo.pt&l...
2018 Apr 30
0
How to visualise what code is processed within a for loop
Hi Rui
Thank you for your suggestion,
I have tested the code suggested by you against that supplied by Don in
terms of timing and results are very much aligned: to populate a 5954x899
0/1 matrix on my machine your procedure took 79 secs, while the one with
ifelse employed 80 secs, hence unfortunately not really any significant
time saved there.
Nevertheless thank you for your contribution.
Kind regards,
Luca
2018-04-28 23:18 GMT+02:00 Rui Barradas <ruipbarradas at sapo.pt...
2018 Apr 30
0
How to visualise what code is processed within a for loop
...e: [R] How to visualise what code is processed within a for
> loop
>
>
>
> Hi Rui
>
> Thank you for your suggestion,
>
>
>
> I have tested the code suggested by you against that supplied by Don in
> terms of timing and results are very much aligned: to populate a 5954x899
> 0/1 matrix on my machine your procedure took 79 secs, while the one with
> ifelse employed 80 secs, hence unfortunately not really any significant
> time saved there.
>
> Nevertheless thank you for your contribution.
>
> Kind regards,
>
>
>
> Luca
>
>
>
&...
2018 Apr 28
2
How to visualise what code is processed within a for loop
I forgot to explain why my suggestion.
The logical condition returns FALSE/TRUE that in R are coded as 0/1.
So all you have to do is coerce to integer.
This works because the ifelse will return a 1 or a 0 depending on the
condition. Meaning exactly the same values. And is more efficient since
ifelse creates both vectors, the true part and the false part, and then
indexes those vectors in