Más contenido relacionado
Diagramパッケージを使ってみる
- 10. ※ 注意...!?
✤ 隣接行列の形式が通常と逆...?
✤ t()で転置行列
✤
> M <- matrix(nrow=4, ncol=4,
byrow=T, data=0)
> M[1,2] <- "12"
> plotmat(M, name=1:4, pos=c(1,2,1))
2009年11月22日日曜日
- 19. その他:細かなパラメータ
✤ 例) ノードの形
✤ とにかく指定できるパラメータが多い...
✤
plotmat(A, pos=NULL, curve=NULL, name=NULL, absent=0,
relsize=1, lwd=2, lcol="black" , box.size=0.1, box.type="circle",
box.prop=1,box.col="white", box.lcol=lcol, box.lwd=lwd,
shadow.size=0.01, shadow.col="grey", dr=0.01, dtext=0.3,
self.lwd=1, self.cex=1, self.shiftx=box.size, self.shifty=NULL,
self.arrpos=NULL, arr.lwd=lwd, arr.lcol=lcol, arr.col="black",
arr.type="curved",arr.pos=0.5, arr.length=0.4, arr.width=arr.length/2,
endhead=FALSE, mx=0.0, my=0.0, box.cex=1, txt.col="black",
prefix="", cex.txt=1, add=FALSE, main="", ...)
2009年11月22日日曜日
- 25. flowchart(node + edge)
✤ openplotmat()関数で描写範囲を作成.
✤ coordinates()関数でノードの個数と位置を指定して
”アタリ”をつける.
✤ ノードのx座標,y座標に従って,ノード・エッジを書き
加えていく.
特徴:ノード,エッジを個別に描く
いわゆる低水準関数的なアレ
2009年11月22日日曜日
- 26. flowchartの描き方
>openplotmat()
> elpos<-coordinates (c
(1,1,2,4))
>fromto <- matrix
(ncol=2,byrow=TRUE,data=c
(1,2,2,3,2,4,4,7,4,8))
2009年11月22日日曜日
- 27. > elpos
[,1] [,2]
[1,] 0.500 0.875
[2,] 0.500 0.625
[3,] 0.250 0.375
[4,] 0.750 0.375
[5,] 0.125 0.125
[6,] 0.375 0.125
[7,] 0.625 0.125
[8,] 0.875 0.125
> fromto
[,1] [,2]
[1,] 1 2
[2,] 2 3
[3,] 2 4
[4,] 4 7
[5,] 4 8
2009年11月22日日曜日
- 28. > textellipse(elpos[1,],0.1,lab="start")
> textrect (elpos[2,],0.15,0.05,lab="found term?")
> textrect (elpos[4,],0.15,0.05,lab="related?")
> textellipse(elpos[3,],0.1,0.1,lab=c("other","term"))
> textellipse(elpos[7,],0.1,0.1,lab=c("make","a link"))
> textellipse(elpos[8,],0.1,0.1,lab=c("new","article"))
案外原始的...
2009年11月22日日曜日
- 30. mar <- par(mar=c(1,1,1,1))
elpos<-coordinates (c(1,1,1,1,1,1,1,1),mx=-0.1)
segmentarrow(elpos[7,],elpos[2,],arr.pos=0.15,dd=0.3,arr.side=3,endhead=TRUE)
segmentarrow(elpos[7,],elpos[3,],arr.pos=0.15,dd=0.3,arr.side=3,endhead=TRUE)
segmentarrow(elpos[7,],elpos[4,],arr.pos=0.15,dd=0.3,arr.side=3,endhead=TRUE)
pin <- par ("pin") # size of plotting region, inches
xx <- 0.2
yy <- xx*pin[1]/pin[2]*0.15
sx <- rep(xx,8)
sx[7] <- 0.05
sy <- rep(yy,8)
sy[6] <-yy*1.5
sy[7] <- sx[7]*pin[1]/pin[2]
for (i in c(1:7)) straightarrow (to=elpos[i+1,],from=elpos
[i,],lwd=2,arr.pos=0.6,endhead=TRUE)
lab <- c("Problem","Conceptual model","Mathematical model","Parameterisation",
"Mathematical solution","","OK?","Prediction, Analysis")
for (i in c(1:5,8)) textround(elpos[i,],sx[i],sy[i],lab=lab[i])
textround(elpos[6,],xx,yy*1.5,lab=c("Calibration,sensitivity","Verification,validation"))
textdiamond(elpos[7,],sx[7],sy[7],lab=lab[7])
textplain(c(0.7,elpos[2,2]),yy*2,lab=c("main components","relationships"),font=3,adj=c
(0,0.5))
textplain(c(0.7,elpos[3,2]),yy ,"general theory",adj=c(0,0.5),font=3)
textplain(c(0.7,elpos[4,2]),yy*2,lab=c("literature","measurements"),font=3,adj=c(0,0.5))
textplain(c(0.7,elpos[6,2]),yy*2,lab=c("field data","lab measurements"),font=3,adj=c(0,0.5))
2009年11月22日日曜日