Commit 398bd6ab authored by Yong Liu's avatar Yong Liu

Refs #5732

parent 62e46a77
......@@ -156,7 +156,31 @@ sdcGUI <- function() {
updateRightFrame()
}
viewkanon2anonymity <- function(){
fk <- ActiveSdcVars("risk")$individual[,2]
TFfk <- fk<2
if(any(TFfk)){
orig <- ActiveSdcVars("origData")
kV <- ActiveSdcVars("manipKeyVars")
nV <- ActiveSdcVars("manipNumVars")
orig <- orig[,!colnames(orig)%in%c(colnames(kV),colnames(nV)),drop=FALSE]
d <- orig
if(!is.null(kV))
d <- cbind(kV,orig)
if(!is.null(nV))
d <- cbind(nV,orig)
xtmp <- cbind(fk[TFfk],d[TFfk,])
colnames(xtmp)[1] <- c("fk")
xtmp <- xtmp[order(xtmp[,1]),]
win = gwindow("Observations violating 2-anoymity", parent=window)
mainGroup1 = ggroup(container=win, horizontal=FALSE)
vkT <- gtable(xtmp)
size(vkT) <- c(800,600)
add(mainGroup1, vkT)
}else
gmessage("No observations violating 2-anonymity", title="Information", icon="info", parent=window)
}
viewkanon <- function(){
fk <- ActiveSdcVars("risk")$individual[,2]
TFfk <- fk<3
......@@ -5238,6 +5262,14 @@ compareDataExport <- function(comparedScript, len, ...){
}
}
keyVariableFreq <- function(sdcObject, step, ...) {
if(existd("sdcObject") == FALSE){
gmessage("There is no dataset loaded for viewing frequencies!", "No Dataset!",icon="warning")
} else{
lrDialog <- gwindow("viewing comparative frequencies for categorical key variables", parent=window, width=600, height=400)
}
}
linearRegression <- function(sdcObject, step, ...) {
if(existd("sdcObject") == FALSE){
gmessage("There is no dataset loaded for Comparison!", "No Dataset!",icon="warning")
......@@ -5564,6 +5596,7 @@ compareDataExport <- function(comparedScript, len, ...){
mbar$Data$"Export"$handler = newDataExport
mbar$Data$"View"$"Original dataset"$handler = viewOriginalDataset
mbar$Data$"View"$"Current dataset"$handler = viewDataset
mbar$Data$"View"$"View Observations violating 2-anonymity"$handler = function(h, ...) viewkanon2anonymity()
mbar$Data$"View"$"View Observations violating 3-anonymity"$handler = function(h, ...) viewkanon()
mbar$Data$"View"$"Observations with risk above the benchmark"$handler = function(h, ...) viewhigh()
mbar$Data$"View"$"Compare dataset"$handler = compareDataset
......@@ -5586,6 +5619,7 @@ compareDataExport <- function(comparedScript, len, ...){
mbar$"Disclosure Risks and Data Utility"$"Categorical Key Variables"$"L-diversity"$handler= function(...) ldiv1()
mbar$"Disclosure Risks and Data Utility"$"Categorical Key Variables"$"PRAM output"$handler = viewpram1
mbar$"Disclosure Risks and Data Utility"$"Categorical Key Variables"$"Linear Regression"$handler= function(...) linearRegression()
mbar$"Disclosure Risks and Data Utility"$"Categorical Key Variables"$"Frequencies for Categorical Key Variables"$handler= function(...) keyVariableFreq()
mbar$"Disclosure Risks and Data Utility"$"Continuous Key Variables"$"Linear Regression"$handler= function(...) linearRegression()
mbar$"Disclosure Risks and Data Utility"$"Continuous Key Variables"$"Test for Association"$handler= function(...) spearmanTest()
mbar$"Disclosure Risks and Data Utility"$"Linear Regression"$handler= function(...) linearRegression()
......
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