I'm experiencing issues in correctly specifying a positions matrix for plotmat()
from diagram
package (technically, that's for different package (plspm
), which uses plotmat()
internally and allows to pass arguments to it). The diagram I'm trying to encode represents very simple graph, but I don't have experience working with graphs and, consequently, with their specification via matrix notation. Thank you for attention.
A
\
\
B--D
/
/
C
Here's what I've tried (among other attempts):
mat <- matrix(c(1, 1, 1, 2, 1, 3, 2, 2), ncol = 2)
plot.plspm(..., pos = mat)
P.S. Also would appreciate, if you could advise on how to control vertical positioning of elements A and C (distance from the B-D line), using plotmat()
.
UPDATE (for @jbaums):
Finally, I have figured it out myself. It's a little tricky, but not a rocket science. Thanks to everyone who tried to help or, at least, read the question. Actually, after I've figured this out, I took another look at the @jbaums' suggestion above and realized that it is basically the same, discounting non-essential details. The suggested solution (which was appearing incorrectly, as shown above) was tested in my
RStudio
, whereas, since my machine withRStudio Server
was down, I had to test my solution onR-Fiddle
... The same company. Same (similar) technology. Go figure. Anyway, here is my obligatory minimal reproducible example (MRE):MRE result: