Dear List,
how can I draw the following path diagram

A B C  D E F
\ | /  \ | /
  G <--> H
 / \    / \
 I J    K L

the problem I've got is that G and H need to be horizontally alingned
but the best I've done is diagonally or vertically alingned,
kind regards,
Rene

## Begin: R-code
#source("http://bioconductor.org/biocLite.R";)
#biocLite("Rgraphviz")
library(Rgraphviz)
library("graph")

# observed x
ox=c('RParAsp',  'RIQ', 'RSES','FSES', 'FIQ', 'FParAsp')
# observed y
oy=c('ROccAsp', 'REdAsp', 'FOccAsp',  'FEdAsp')
# latend
l=c('FGenAsp','RGenAsp')

# pure nodes in a line
l1 <- new("graphNEL", nodes = c(ox,oy,l), edgemode = "directed")
plot(l1, "dot")

l1 <- addEdge("RParAsp", "RGenAsp", l1)
l1 <- addEdge("RIQ", "RGenAsp", l1)
l1 <- addEdge("RSES", "RGenAsp", l1)

l1 <- addEdge("FParAsp", "FGenAsp", l1)
l1 <- addEdge("FIQ", "FGenAsp", l1)
l1 <- addEdge("FSES", "FGenAsp", l1)

l1 <- addEdge("FGenAsp", "FOccAsp", l1)
l1 <- addEdge("FGenAsp", "FEdAsp", l1)

l1 <- addEdge("RGenAsp", "ROccAsp", l1)
l1 <- addEdge("RGenAsp", "REdAsp", l1)

l1 <- addEdge("RGenAsp", "FGenAsp", l1)
l1 <- addEdge("FGenAsp", "RGenAsp", l1)

plot(l1, recipEdges="distinct")

sub1 <- subGraph(ox, l1)
sub2 <- subGraph(oy, l1)
sub3 <- subGraph(l, l1)


sublist <-
  list( list(graph=sub1, cluster = T) ,
        list(graph=sub2, cluster = T),
        list(graph=sub3, cluster = T)

  )


plot(l1,
     subGList = sublist)
globalattrs$graph <- list(rankdir = "LR")
plot(l1, attrs = globalattrs)
## End: R-code

______________________________________________
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