Re: [R] Vector Manipulation

From: Doran, Harold <HDoran_at_air.org>
Date: Sat 17 Jun 2006 - 06:48:07 EST


I think you want

ifelse(x=='N',0,1)

> -----Original Message-----
> From: r-help-bounces@stat.math.ethz.ch
> [mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of Davis,
> Jacob B.
> Sent: Friday, June 16, 2006 4:46 PM
> To: r-help@stat.math.ethz.ch
> 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]]
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Jun 17 06:53:13 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 17 Jun 2006 - 08:11:50 EST.

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