How would I create a matrix (the normal sense, not the R sense) where the (i,j) entry is a function of i and j? I think it involves apply() but I can’t seem to work out how to use it.
Say if I have columns x1, x2, … and rows y1,y2 where the x1 and y1 are R objects and I want to build a table/matrix where the entry is a function of xi and yj for each i and j.
Sorry if this has been answered elsewhere.
I’m not sure I understand the entire question. I will just answer the question in the first sentence: