-
Notifications
You must be signed in to change notification settings - Fork 21
/
CompareModels.Rmd
36 lines (31 loc) · 1.16 KB
/
CompareModels.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
---
title: "Compare `r modelname_pair[1]` and `r modelname_pair[2]` Model"
date: "`r Sys.Date()`"
output:
html_document:
keep_md: yes
editor_options:
chunk_output_type: console
---
This document presents comparison results of `r modelname_pair[1]` and `r modelname_pair[2]` model.
#### Compare flow totals between two models
```{r, results='markup'}
mA <- buildModel(modelname_pair[1])
mB <- buildModel(modelname_pair[2])
```
```{r}
# Compare flow totals
model_com <- compareFlowTotals(mA, mB)
cat(paste("Number of flow totals by commodity passing:",model_com$N_Pass))
cat(paste("Number of flow totals by commodity failing:",model_com$N_Fail))
#cat(paste("Sectors with flow totals failing:", paste(model_com$Failure$rownames, collapse = ", ")))
```
```{r echo=FALSE}
if (!is.null(model_com[["FlowDifference"]])) {
cat("There are flow differences between", mA$specs$Model, "and", mB$specs$Model, "\n\n")
cat(names(model_com[["FlowDifference"]])[1], "are\n\n")
print(unlist(model_com[["FlowDifference"]][1], use.names = FALSE))
cat("\n", names(model_com[["FlowDifference"]])[2], "are\n\n")
print(unlist(model_com[["FlowDifference"]][2], use.names = FALSE))
}
```