Hi,

    I have three matrices which could be, for example:
    A =  0, NA
           NA, 3

    B =  1, NA
            0, NA

    C = 1, NA
            1, 1

    (The point is that they all may have NA's in some cells)

    QUESTION: How do I perform a element-by-element sum of the elements of
    these three matrices (A + B + C), ignoring NA's, to obtain:

    D = 2, NA
           1, 4

    In reality I am handling much larger matrices (not just 2x2).

    Thank you for any help!

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to