Re: [R] question

From: Greg Snow <Greg.Snow_at_imail.org>
Date: Thu, 20 Dec 2007 14:34:03 -0700

?ifelse

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_imail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces_at_r-project.org
> [mailto:r-help-bounces_at_r-project.org] On Behalf Of Armelini, Guillermo
> Sent: Wednesday, December 19, 2007 10:21 AM
> To: r-help_at_stat.math.ethz.ch
> Subject: [R] question
>
> Hello everyone!
>
> Is anybody can help me to solve this silly question that
> unfortunately I haven't found the right way to address it.
>
> Supose I have a matrix X[n,n] dimension
>
> I would like to calculate the product of the vectors
>
> Y=X[1,n]*X[n,1]
>
> Then I would like to run the following operation
>
> H=if(Y>0) {H[,1]=1}
>
> The problem is that the condition "if" works only for the
> first element of the matrix.
>
> Does anybody knows how to apply the conditional "if" to a
> entire vector?
>
> cheers
>
> Guillermo
>
>
>
> This message has been scanned for viruses by TRENDMICRO, an
> IESE technology affiliate company and global leader in
> antivirus and content security software.
>
> ______________________________________________
> 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.
>
______________________________________________ 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 Thu 20 Dec 2007 - 21:37:03 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 Thu 20 Dec 2007 - 22:30:21 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.