> To: r-help@r-project.org
> Subject: [R] problem with if else statement
>
> Dear colleagues,
>
> What did I not understand ?
>
> ->my intention
> I want to create a new variable:
> In plain language:
> If someone is taking anithypertensive treatment (med.hy
lf Of Peter Lercher
Sent: 08 June 2010 10:18
To: r-help@r-project.org
Subject: [R] problem with if else statement
Dear colleagues,
What did I not understand ?
->my intention
I want to create a new variable:
In plain language:
If someone is taking anithypertensive treatment (med.hyper==1)
table(m
Hi Peter!
The 'if' function operate on a single logical expression, while you provided
a vector. What your code does at present is subtract 5 from all values in
rr.dia.2m if the first value in med.hyper is 1 and otherwise simply returns
all values as is. Since you have no reproducible data, it's h
Dear colleagues,
What did I not understand ?
->my intention
I want to create a new variable:
In plain language:
If someone is taking anithypertensive treatment (med.hyper==1)
table(med.hyper)
med.hyper
0 1
472 97
I want to subtract 5 mmHg (rr.dia.2m-5) from the measured diastolic
blood pres
4 matches
Mail list logo