Re: [R] Help on apply() function

From: Mark Lyman <mark.lyman_at_gmail.com>
Date: Wed 30 Aug 2006 - 14:42:08 EST

Anusha <anu1978 <at> hotmail.com> writes:

>
> Respected Sir/Madam,
>
> I have a problem with apply function. I have to two matrices of dimension of
> one column but n rows. I have to check whether one matrix is greater than
> other by going thru each row (ie) using if condition to check one matrix
> with another matrix.
>
> I like to use apply() function to this approach. That is apply function
> between two matrices. I searched for examples online but I couldn't find
> any.
>
> I don't know how to loop thru the matrices.
>
> Please help with this problem.
>
> Any help is appreciated.
>

> My mailid is monkponu <at> yahoo.com.
>
> Thanks,
> Anusha.
>

You can use the functions all.equal with the function isTRUE (see ?all.equal) to check if two objects are nearly equal (within a certain tolerance). Or you can use identical (see ?identical) to check if they are exactly the same. See the examples in the help for identical.

Mark Lyman



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 and provide commented, minimal, self-contained, reproducible code. Received on Wed Aug 30 14:49:26 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 Wed 30 Aug 2006 - 22:23:43 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.