I think you want ifelse(x=='N',0,1)
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Davis, > Jacob B. > Sent: Friday, June 16, 2006 4:46 PM > To: [email protected] > Subject: [R] Vector Manipulation > > I have a vector that has 1,974 elements and each element is > one of the following (B, F, N, Y). How do I recreate that > vector accept in the place of N put 0 and in the place of B, > F or Y put a 1? > > > > Thanks, > > Jacob > > > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
