[R] Comparing each component of vector to each component of a Matrix.
Frederic Ntirenganya
ntfredo at gmail.com
Wed Mar 11 08:01:06 CET 2015
Hi All,
I need a help on a loop which can compare the each component of vector to
each component of a Matrix.
Let a vector b = {b1, b2, ...,bn} and 2x2 matrix A = Aij.
I need to compare each component of the vector with each component of a
matrix and print 1 if the component is less or equal to one and print 0
otherwise.
bi <= Aij, print 1 and 0 otherwise.
Any help is appreciated.
Regards,
Frederic.
Frederic Ntirenganya
Maseno University,
African Maths Initiative,
Kenya.
Mobile:(+254)718492836
Email: fredo at aims.ac.za
https://sites.google.com/a/aims.ac.za/fredo/
[[alternative HTML version deleted]]
More information about the R-help
mailing list