Commit cf651dac authored by Yong Liu's avatar Yong Liu

only compare dateset on categorical variables and numerical variables

parent e6b1659d
......@@ -2912,7 +2912,7 @@ sdcGUI <- function() {
if(existd("sdcObject")) {
sdcObject = ActiveSdcObject()
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", sep=" ")
selectedNames <- c(names(sdcObject@manipKeyVars),names(sdcObject@manipNumVars), names(sdcObject@manipPramVars), names(sdcObject@manipStrataVar))
selectedNames <- c(names(sdcObject@manipKeyVars),names(sdcObject@manipNumVars))
glayout <- glayout(container=compareDatasetDialogFrame,expand=TRUE)
glayout[1,1] <- onlydiff <- gcheckbox("Only show difference", handler=function(h,...){
sdcObject = ActiveSdcObject()
......@@ -3044,7 +3044,7 @@ sdcGUI <- function() {
updateDifference(glayout, newdf, olddf, svalue(onlydiff))
svalue(compareDatasetDialog) <- paste("Dataset:", ncol(sdcObject@origData), "variables", nrow(sdcObject@origData), "records", ", impacted obs:", length(getd("compare.dataset.diff")), sep=" ")
})
selectedNames <- c(names(sdcObject@manipKeyVars),names(sdcObject@manipNumVars), names(sdcObject@manipPramVars), names(sdcObject@manipStrataVar))
selectedNames <- c(names(sdcObject@manipKeyVars),names(sdcObject@manipNumVars))
svalue(variableList) <- names(sdcObject@origData)[names(sdcObject@origData) %in% selectedNames]
newdf <- data[names(data) %in% selectedNames]
olddf <- sdcObject@origData[names(sdcObject@origData) %in% selectedNames]
......@@ -5944,7 +5944,9 @@ compareDataExport <- function(comparedScript, len, ...){
tryCatch({
cor.S = cor.test(sdcObject@origData[,selTab[]], data[,selTab[]], method = svalue(methodSel))
rho= cor.S$estimate
svalue(outputlabel) <- paste("<span weight=\"bold\" size=\"medium\">Test for association between current data and original data is:</span>","\nstatistic = ", cor.S$statistic, "\n","p = ", cor.S$p.value, "\n", c("The cor is : ", "The tau is:", "The rho is:")[grep(svalue(methodSel), c("pearson", "kendall", "spearman"))], rho, sep="")}
svalue(outputlabel) <- paste("<span weight=\"bold\" size=\"medium\">Test for association between current data and original data is:</span>"
,"\nstatistic = ", cor.S$statistic, "\n","p = ", cor.S$p.value, "\n"
, c("The cor is : ", "The tau is : ", "The rho is : ")[grep(svalue(methodSel), c("pearson", "kendall", "spearman"))], rho, sep="")}
,
error=function(e){
svalue(outputlabel) <- paste("error:\n", e, "")
......
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