Commit f76d3017 authored by Yong Liu's avatar Yong Liu

Refs #6190

parent b93e623d
......@@ -360,12 +360,29 @@ sdcGUI <- function() {
orig2violate <- sum(originalRisk$individual[,2]<2)
orig3violate <- sum(originalRisk$individual[,2]<3)
origexpectedrisk <- round(originalRisk$global$risk_ER,2)
CurrentCount = 0
if(!is.null(risk$global$hier_risk_ER)) {
CurrentCount = round(risk$global$hier_risk_ER,2)
}
CurrentPercentage = 0
if(!is.null(risk$global$hier_risk_pct)) {
CurrentPercentage = round(risk$global$hier_risk_pct,2)
}
OrigCount = 0
if(!is.null(originalRisk$global$hier_risk_ER)) {
OrigCount = round(originalRisk$global$hier_risk_ER,2)
}
OrigPercentage = 0
if(!is.null(originalRisk$global$hier_risk_ER)) {
OrigPercentage = round(originalRisk$global$hier_risk_pct,2)
}
n <- nrow(ActiveSdcObject()@origData)
svalue(nbMain) <- 1
keyvariablerisktable[] = data.frame(c("violating 2-anonymity", "violating 3-anonymity", "risk-higher than the benchmark", "expected Risk"), c(current2violate, current3violate, currenthighrisk, currentexpectedrisk),
c(orig2violate, orig3violate, orighighrisk, origexpectedrisk),
c(round(current2violate/n * 100, 2), round(current3violate/n * 100, 2), round(currenthighrisk/n * 100, 2), round(currentexpectedrisk/n * 100, 2)),
c(round(orig2violate/n * 100, 2), round(orig3violate/n * 100, 2), round(orighighrisk/n * 100, 2), round(origexpectedrisk/n * 100, 2)),stringsAsFactors=FALSE)
keyvariablerisktable[] = data.frame(c("violating 2-anonymity", "violating 3-anonymity", "risk-higher than the benchmark", "Re-indentification, global risk", "Re-indentification, hierarchical risk"),
c(current2violate, current3violate, currenthighrisk, currentexpectedrisk, CurrentCount),
c(orig2violate, orig3violate, orighighrisk, origexpectedrisk, OrigCount),
c(paste(round(current2violate/n * 100, 2), "%", SEP=""), paste(round(current3violate/n * 100, 2), "%", SEP=""), paste(round(currenthighrisk/n * 100, 2), "%", SEP=""), paste(round(currentexpectedrisk/n * 100, 2), "%", SEP=""),paste(CurrentPercentage, "%", SEP="")),
c(paste(round(orig2violate/n * 100, 2), "%", SEP=""), paste(round(orig3violate/n * 100, 2), "%", SEP=""), paste(round(orighighrisk/n * 100, 2), "%", SEP=""), paste(round(origexpectedrisk/n * 100, 2), "%", SEP=""),paste(OrigPercentage, "%", SEP="")),stringsAsFactors=FALSE)
visible(keyvariableriskgraph) <- TRUE
barplot(matrix(c(current2violate, orig2violate,
current3violate, orig3violate,
......@@ -5477,8 +5494,8 @@ compareDataExport <- function(comparedScript, len, ...){
fc_tmp = gframe('<span size="medium" weight="bold">Frequency calculations</span>', expand=TRUE,markup=TRUE,container= tmpCR)
tmp = gframe("", container=fc_tmp,horizontal=FALSE, expand=TRUE)
keyvariablerisktable = gtable(data.frame("Property"=c(""), "obs.orig.count"=c(""),"obs.curr.count"=c(""),
"pct.orig.count"=c(""),"pct.curr.count"=c(""),stringsAsFactors=FALSE), container=tmp, width=280, height=250, expand=TRUE)
keyvariablerisktable = gtable(data.frame("risk.calculations"=c(""), "curr.count"=c(""),"orig.count"=c(""),
"curr.pct"=c(""),"orig.pct"=c(""),stringsAsFactors=FALSE), container=tmp, width=280, height=250, expand=TRUE)
keyvariableriskgraph = ggraphics(container=tmp, width=280, height=200)
keyvariableFreqGroup <- ggroup(container=tmp, width=280, height=250, expand=TRUE)
keyvariableFreqTable <- gtable(data.frame("Frequency"=c(""),stringsAsFactors=FALSE), container=keyvariableFreqGroup, width=280, height=250, expand=TRUE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment