I am trying to convert a 3-column CSV to arcplot. Columns - A, B, Care always in the order of A→ B→ C. However, I did not see a way to implement this as arcs, since most approaches apparently used a two-sided edge plot. Therefore, I follow the instructions here to convert to an adjacency matrix.
I recreate the problem below - but do not create artificial data, since one problem is that the CSV may not be read correctly.
Basically, the CSV contains rows where each column is separated by a character ,, but can contain several values separated by a character ;, for example:
ENV;MO,echoic;tact,social
ENV;MO,mand,physical
OVB,intraverbal,social
ENV;OVB,tact,social
OVB,intraverbal;tact,social
OVB;ENV;MO,intraverbal;mand,social
OVB;ENV;MO,intraverbal;mand,physical;social
ENV;MO,mand,social;physical
, arcplots:
options(stringsAsFactors = F)
lst <- read.csv("abc.csv", header=FALSE)
d <- do.call(rbind, lst)
edges <- rbind(d[ ,1:2], d[ ,2:3])
g <- graph.data.frame(edges, directed=TRUE)
adj <- as.matrix(get.adjacency(g))
g2 <- new("graphAM", adjMat=adj, edgemode="directed")
plot(g2, attrs = list(graph = list(rankdir="LR"), node = list(fillcolor = "lightblue")))
, . A, B, C. , A, ; B, , , , intraverbal → mand → intraverbal; tact C, C.
: A → B → C ,
OVB; ENV, MO, intraverbal; MAND,
A (OVB & ENV & MO) → B ( & mand) → C ()
, , , PDF- R