Hello,
I am almost a total novice, and I am sure there must be an easy (and
basic) way to turn a variable of 1's and 2's into a variable of zeros
and ones. This is in a data frame, but if I could do it with vectors,
that's all I need.
Can someone tell me how?
Thanks so much,
Jen
Le 25 Octobre 2005 15:51, Jennifer Dillon a écrit :
Hello,
I am almost a total novice, and I am sure there must be an easy (and
basic) way to turn a variable of 1's and 2's into a variable of zeros
and ones. This is in a data frame, but if I could do it with vectors,
that's all I need.
x-c(1, 2);
y-ifelse(x==1, 1, 0);
On 10/25/05, Jennifer Dillon [EMAIL PROTECTED] wrote:
Hello,
I am almost a total novice, and I am sure there must be an easy (and
basic) way to turn a variable of 1's and 2's into a variable of zeros
and ones. This is in a data frame, but if I could do it
-9140x23604
http://socserv.mcmaster.ca/jfox
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jennifer Dillon
Sent: Tuesday, October 25, 2005 2:52 PM
To: r-help@stat.math.ethz.ch
Subject: [R] making an inicator variable