[R] Odp: partial solutions to: if else statement problem

From: Petr PIKAL <petr.pikal_at_precheza.cz>
Date: Tue, 08 Jun 2010 14:38:33 +0200

Hi

r-help-bounces_at_r-project.org napsal dne 08.06.2010 14:21:10:

> Thank you to all for your help!
>
> I received
> two equal alternative solutions that bypassed elegantly the problem
> from peter.l.e.konings_at_gmail.com
> and
> rafael.bjork_at_gmail.com
>
> rr.dia2.corr <- rr.dia.2m
> rr.dia2.corr[which(med.hyper == 1)] <- rr.dia.2m[which(med.hyper == 1)]
- 5

Try to compare it with my suggestion

my.result <- rr.dia.2m - (med.hyper == 1)*5 all.eqal(rr.dia2.corr, my.result)

which by my opinion will be same.

Regards
Petr

>
> From pburns@pburns.seanet.com
> I received a hint to understand the problem why my code does not work.
> p 13 on
> http://lib.stat.cmu.edu/S/Spoetry/Tutor/R_inferno.pdf
>
> I have to digest this yet
>
> Peter
>
>
> ______________________________________________
> 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.



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. Received on Tue 08 Jun 2010 - 12:41:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 08 Jun 2010 - 12:50:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive