W dniu 2011-06-08 04:24, Anamika Chaudhuri pisze:
> Hi All:
>
> I need to ask a very simple question. I am trying to code the
> following if then else statement in R.
>
> If low_cl<p<up_cl then coverage=1;
> else coverage=0;
>
> Any help will be appreciated.
Hi Anamika,
> low_cl<-1.0;
> high_cl<-3.0;
> p<-0.5;
> if (low_cl<p && p<high_cl) coverage<-1 else coverage<-0;
> coverage;
[1] 0
> p<-2.2;
> if (low_cl<p && p<high_cl) coverage<-1 else coverage<-0;
> coverage;
[1] 1
> p<-3.0;
> if (low_cl<p && p<high_cl) coverage<-1 else coverage<-0;
> coverage;
[1] 0
>
Is that you asked for?
Best regards,
Wojciech Jawien
Jagiellonian University
Krakow, Poland
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|