Commit d822036f authored by Yong Liu's avatar Yong Liu

Refs #6263

parent 2b5dc647
......@@ -378,7 +378,7 @@ sdcGUI <- function() {
}
n <- nrow(ActiveSdcObject()@origData)
svalue(nbMain) <- 1
keyvariablerisktable[] = data.frame(c("N1", "N2", "N3", "N4", "N5"),
keyvariablerisktable[] = data.frame(c("R1", "R2", "R3", "R4", "R5"),
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),
......@@ -391,7 +391,7 @@ sdcGUI <- function() {
round(currentexpectedrisk/n * 100, 2),round(origexpectedrisk/n * 100, 2),
CurrentPercentage, OrigPercentage
)
barplot(matrix(counts, nrow = 2, ncol = 5), beside = TRUE, main="Percentage of observations at risk", names.arg=c("N1", "N2","N3", "N4", "N5"))
barplot(matrix(counts, nrow = 2, ncol = 5), beside = TRUE, main="Percentage of observations at risk", names.arg=c("R1", "R2","R3", "R4", "R5"))
m1 <- ActiveSdcVars("risk")$individual
xtmp <- ActiveSdcVars("manipKeyVars")
tabDat <- cbind(xtmp,m1)
......@@ -828,6 +828,7 @@ sdcGUI <- function() {
gmessage("You need to select at least 1 variable!", title="Information", icon="info", parent=nm2_window)
} else {
microaggregation_tmp(aggrVal, svalue(methodSel), vars=selTab[],strata_variables=selTab1[])
svalue(nbMain) <- 2
dispose(nm2_window)
}
})
......@@ -1104,6 +1105,7 @@ sdcGUI <- function() {
gmessage("You need to select at least 1 variable!", title="Information", icon="info", parent=nm1_window)
} else {
addNoise_tmp(noise, svalue(methodSel), selTab[])
svalue(nbMain) <- 2
dispose(nm1_window)
}
}
......@@ -1311,6 +1313,7 @@ sdcGUI <- function() {
gmessage("You need to select at least 2 predictor variable!", title="Information", icon="info", parent=nm2_window)
} else {
shuffle_tmp(method=svalue(methodSel),regmethod=svalue(regmethodSel),covmethod=svalue(covmethodSel), xvars=selTab[],yvars=selTab1[])
svalue(nbMain) <- 2
dispose(nm2_window)
}
})
......@@ -1377,6 +1380,7 @@ sdcGUI <- function() {
} else {
topcoding_tmp(value=svalue(limitValueTxt), replacement=svalue(replaceValueTxt),
kind=svalue(methodSel), column=names(varList[match(svalue(varSel), varList)]))
svalue(nbMain) <- 2
dispose(topcoding_window)
}
}
......@@ -2268,10 +2272,8 @@ sdcGUI <- function() {
"% (orig.", origrisknum, "%)", SEP="")
visible(continuousvariableriskgraph) <- TRUE
counts <- c(round(100*risk$numeric,2), origrisknum)
bplt <- barplot(counts, beside = TRUE, main="Disclosure risk",
#legend=c("curr risk", "orig risk"),
col=c("blue","grey"),
space=4, names.arg=counts)
bplt <- barplot(matrix(counts, nrow = 2, ncol = 1), beside = TRUE, main="Disclosure risk",
space=4, names.arg=c("curr risk", "orig risk"))
visible(continuousvariablelossgraph) <- TRUE
namelist <- names(obj@manipNumVars)
lossgraphcombo[] <- namelist
......@@ -5199,7 +5201,7 @@ compareDataExport <- function(comparedScript, len, ...){
g <- ggraphics()
add(barcharRiskTab, g, expand=TRUE)
barcharFreqTab <- ggroup(horizontal=FALSE, container=nb,label="Barchart of Population Frequencies tab")
barcharFreqTab <- ggroup(horizontal=FALSE, container=nb,label="Barchart of Population Frequencies")
g1 <- ggraphics()
add(barcharFreqTab, g1, expand=TRUE)
......@@ -5213,9 +5215,9 @@ compareDataExport <- function(comparedScript, len, ...){
} else if(h$pageno == 3) {
visible(g1) <- TRUE
if(nrow(tabDat) > 10) {
try(barplot(c(as.numeric(tabDat$Fk[1:10])), main="Ten Lowest Population Frequencies for Categorical Key Variables", horiz =TRUE, cex.names=0.5, names.arg=do.call(paste0, tabDat[1:10, names(sdc@manipKeyVars)]), las=1), silent=TRUE)
try(barplot(c(as.numeric(tabDat$Fk[1:10])), main="Ten Lowest Population Frequencies for Categorical Combinations", horiz =TRUE, cex.names=0.5, names.arg=do.call(paste0, tabDat[1:10, names(sdc@manipKeyVars)]), las=1), silent=TRUE)
} else {
try(barplot(c(as.numeric(tabDat$Fk)), main="Population Frequencies for Categorical Key Variables", horiz =TRUE, cex.names=0.5, names.arg=do.call(paste0, tabDat[names(sdc@manipKeyVars)]), las=1), silent=TRUE)
try(barplot(c(as.numeric(tabDat$Fk)), main="Population Frequencies for Categorical Combinations", horiz =TRUE, cex.names=0.5, names.arg=do.call(paste0, tabDat[names(sdc@manipKeyVars)]), las=1), silent=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