forked from andandandand/OACC
-
Notifications
You must be signed in to change notification settings - Fork 5
/
report.Rmd
59 lines (40 loc) · 1.35 KB
/
report.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
title: "Perturbation Analysis Report"
output: html_document
params:
perturbationCounter: NA
graphHistory: !r list()
pvHistory: !r list()
peHistory: !r list()
delEventHistory: !r list()
---
```{r eval = FALSE, echo = FALSE}
# For PDF output, change the header to have "output: pdf_document".
#
# Note that due to an issue in rmarkdown, the default value of a parameter in
# the header cannot be `NULL`, so I used a default of `NA` for the default value
# of `n`.
require(igraph)
require(knitr)
require(xtable)
```
```{r results= 'asis', echo = FALSE}
# https://stackoverflow.com/questions/28313600/r-knitr-print-in-a-loop
# https://github.com/yihui/knitr/issues/886
#https://stackoverflow.com/questions/32418860/output-markdown-in-r-code-chunk
for (i in 1:params$perturbationCounter){
cat('\n')
cat(paste0("### ",params$delEventHistory[[i]]))
cat('\n')
coords <- layout_(params$graphHistory[[i]], as_star())
plot(params$graphHistory[[i]], layout = coords, edge.arrow.size = 0.4,
vertex.size = 25, vertex.label.family = "Arial Black")
cat('\n')
print(knitr::kable(params$pvHistory[[i]], caption = "Possible node perturbations",
row.names = FALSE))
cat('\n')
print(knitr::kable(params$peHistory[[i]], caption = "Possible link perturbations",
row.names = FALSE))
cat('\n')
}
```