Skip to content

Commit 901a01b

Browse files
committed
try to handle transformation
1 parent 12a2987 commit 901a01b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

R/DataQualityFunctions.R

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,14 @@ createB_dqi <- function(model) {
109109
df_cast <- df_cast[, model$Industries$Code_Loc]
110110
dqi <- as.matrix(df_cast)
111111

112-
# Need to Transform into a flow x commodity matrix using market shares matrix for commodity models
113-
# see createBfromFlowDataandOutput()
114-
112+
## Need to Transform into a flow x commodity matrix using market shares matrix for commodity models?
113+
## see createBfromFlowDataandOutput()
114+
if(model$specs$CommodityorIndustryType == "Commodity") {
115+
dqi <- dqi %*% model$V_n
116+
# ^^ is this correct? needs to reassign scores across commodities instead of industries
117+
colnames(dqi) <- model$Commodities$Code_Loc
118+
}
119+
115120
# array(combined_vector, dim = c(5, 5, 5))
116121

117122

0 commit comments

Comments
 (0)