Re: [R] value transformations in a vector

From: Peter Alspach <PAlspach_at_hortresearch.co.nz>
Date: Fri, 16 May 2008 09:16:55 +1200

Juan Pablo

Look at the results of:

as.numeric(A!=1)

and

A[A!=1]

HTH ....... Peter Alspach  

> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Juan Pablo Fededa
> Sent: Friday, 16 May 2008 1:36 a.m.
> To: r-help
> Subject: [R] value transformations in a vector
>
> Dear contributors:
>
> I have vector A composed of numbers wich have values equal to
> 1 and different to 1.
> I want to transform de components with a value=1 to a
> component of value=0, and those with a value different to1,
> to a value=1.
> Then I want to take out the components=0.
> Thanks in advance,
>
>
> Juan Pablo
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

The contents of this e-mail are privileged and/or confidential to the named  recipient and are not to be used by any other person and/or organisation.  If you have received this e-mail in error, please notify the sender and delete  all material pertaining to this e-mail.



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 16 May 2008 - 08:35:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 16 May 2008 - 09:30:37 GMT.

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

list of date sections of archive