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 ______________________________________________ [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 and provide commented, minimal, self-contained, reproducible code.
