[R] Help on plot from transition matrix
Luis Fernando García
|uy@g@rc|@ @end|ng |rom gm@||@com
Mon Aug 24 01:04:20 CEST 2020
I am wanting to make a flow diagram like the one attached as an example for
the given dataset.
The idea is to plot a flow diagramm using the probabilities given by a
transition matrix like the displayed in the example below. I have found
some tools like DiagrammeR which might work for this purpose, but it works
by introducing values manually. I wanted to know if there exists any
package able to plot automatically the flow diagram, given the transition
probabilities.
Thanks in advance.
#######
library(TraMineR)
h2a=c("Q-X-Q-Y-W-Z-P")
h3a=c("Q-X-Q-Y-W-Z-P-Q-M-P-Q-A")
h4a=c("Q-X-Q-X-Q-X-Q-Y-W-Z-C-B-Q-M-B-Q-A")
h6a=c("Q-X-Q-X-Q-Y-W-Z-P-Q-P-Q-M-Q-A")
h7a=c("Q-Y-W-Z-P-Q-B-Q-M-A")
h8a=c("Q-Y-W-Z-P-B-Q-M-Q-A")
h9a=c("Q-X-Q-W-Z-B-Q-A")
h10a=c("Q-Y-W-Z-Q-A")
h11a=c("Q-Y-W-Z-B-Q-P-B-Q-M-A")
h12a=c("Q-W-Z-B-P-Q-A")
h13a=c("Q-X-Q-Y-W-Z-P-Q-A")
h14a=c("Q-X-B-X-Q-X-B-Q-X-Q-X-Q-Y-W-Z-B-P-B-Q-A")
h15a=c("Q-X-Y-W-Z-B-P-Q-B-Q-A")
h16a=c("Q-X-Q-B-Q-X-B-X-Q-Y-W-Z-P-B-Q-A")
h17a=c("Q-X-Q-X-B-X-Q-W-Z-P-B-P-Q-A")
h18a=c("Q-Y-W-Z-B-P-Q-B-Q-P-Q-M-B-P-A")
h19a=c("Q-W-Z-B-P-Q-P-Q-M-Q-A")
a=c(h2a,h3a,h4a,h6a,h7a,h8a,h9a,h10a,h11a,h12a,h13a,h14a,h15a,h16a,h17a,h18a,h19a)
a
library(TraMineR)
i1=seqdef(c(h2a,h3a,h4a,h6a,h7a,h8a,h9a,h10a,h11a,h12a,h13a,h14a,h15a,h16a,h17a,h18a,h19a))
seqtrate(i1)
More information about the R-help
mailing list