Skip to contents

The SSBtools function WildcardGlobbing is utilized

Usage

PrimaryRemoveWg(wg = NULL, ..., crossTable)

CandidatesNumWg(wg = NULL, ..., crossTable)

ForcedWg(crossTable, wg = NULL, ...)

Arguments

wg

data.frame with wildcard/globbing. A parameter to WildcardGlobbing

...

unused parameters

crossTable

crossTable generated by parent function

Value

logical vector or row indices

Details

CandidatesNumWg is a generalization of CandidatesNumWg

Examples

dataset <- SSBtoolsData("magnitude1")

a1 <- SuppressDominantCells(data = dataset, numVar = "value", 
       dimVar = c("sector4", "geo"), n = 1:2, k = c(77, 99))
#> [extraAggregate 20*3->10*4] Checking ....
#> GaussSuppression_numttHTT: ............

a1
#>          sector4      geo value primary suppressed
#> 1          Total    Total 462.3   FALSE      FALSE
#> 2          Total  Iceland  37.1   FALSE      FALSE
#> 3          Total Portugal 162.5   FALSE      FALSE
#> 4          Total    Spain 262.7   FALSE      FALSE
#> 5    Agriculture    Total 240.2   FALSE      FALSE
#> 6    Agriculture  Iceland   0.0   FALSE      FALSE
#> 7    Agriculture Portugal 100.4    TRUE       TRUE
#> 8    Agriculture    Spain 139.8    TRUE       TRUE
#> 9  Entertainment    Total 131.5   FALSE      FALSE
#> 10 Entertainment  Iceland  16.8    TRUE       TRUE
#> 11 Entertainment Portugal   9.4    TRUE       TRUE
#> 12 Entertainment    Spain 105.3   FALSE       TRUE
#> 13  Governmental    Total  32.8   FALSE      FALSE
#> 14  Governmental  Iceland   0.0   FALSE      FALSE
#> 15  Governmental Portugal  23.6    TRUE       TRUE
#> 16  Governmental    Spain   9.2    TRUE       TRUE
#> 17      Industry    Total  57.8   FALSE      FALSE
#> 18      Industry  Iceland  20.3   FALSE       TRUE
#> 19      Industry Portugal  29.1    TRUE       TRUE
#> 20      Industry    Spain   8.4    TRUE       TRUE

wg <- data.frame(sector4 = "Ind*", geo = c("Ice????", "Portugal"))
wg
#>   sector4      geo
#> 1    Ind*  Ice????
#> 2    Ind* Portugal

# Industry:Portugal not primary, but suppressed
a2 <- SuppressDominantCells(data = dataset, numVar = "value", 
       dimVar = c("sector4", "geo"), n = 1:2, k = c(77, 99), 
       wg = wg, primary = c(DominanceRule, PrimaryRemoveWg))
#> [extraAggregate 20*3->10*4] Checking ....
#> GaussSuppression_numttHTT: ............:

a2
#>          sector4      geo value primary suppressed
#> 1          Total    Total 462.3   FALSE      FALSE
#> 2          Total  Iceland  37.1   FALSE      FALSE
#> 3          Total Portugal 162.5   FALSE      FALSE
#> 4          Total    Spain 262.7   FALSE      FALSE
#> 5    Agriculture    Total 240.2   FALSE      FALSE
#> 6    Agriculture  Iceland   0.0   FALSE      FALSE
#> 7    Agriculture Portugal 100.4    TRUE       TRUE
#> 8    Agriculture    Spain 139.8    TRUE       TRUE
#> 9  Entertainment    Total 131.5   FALSE      FALSE
#> 10 Entertainment  Iceland  16.8    TRUE       TRUE
#> 11 Entertainment Portugal   9.4    TRUE       TRUE
#> 12 Entertainment    Spain 105.3   FALSE       TRUE
#> 13  Governmental    Total  32.8   FALSE      FALSE
#> 14  Governmental  Iceland   0.0   FALSE      FALSE
#> 15  Governmental Portugal  23.6    TRUE       TRUE
#> 16  Governmental    Spain   9.2    TRUE       TRUE
#> 17      Industry    Total  57.8   FALSE      FALSE
#> 18      Industry  Iceland  20.3   FALSE       TRUE
#> 19      Industry Portugal  29.1   FALSE       TRUE
#> 20      Industry    Spain   8.4    TRUE       TRUE

# Industry:Portugal not primary and not suppressed
a3 <- SuppressDominantCells(data = dataset, numVar = "value", 
       dimVar = c("sector4", "geo"), n = 1:2, k = c(77, 99), 
       wg = wg, primary = c(DominanceRule, PrimaryRemoveWg), 
       candidates = CandidatesNumWg)
#> [extraAggregate 20*3->10*4] Checking ....
#> GaussSuppression_numttHTT: ........:::::
a3
#>          sector4      geo value primary suppressed
#> 1          Total    Total 462.3   FALSE      FALSE
#> 2          Total  Iceland  37.1   FALSE       TRUE
#> 3          Total Portugal 162.5   FALSE       TRUE
#> 4          Total    Spain 262.7   FALSE      FALSE
#> 5    Agriculture    Total 240.2   FALSE      FALSE
#> 6    Agriculture  Iceland   0.0   FALSE      FALSE
#> 7    Agriculture Portugal 100.4    TRUE       TRUE
#> 8    Agriculture    Spain 139.8    TRUE       TRUE
#> 9  Entertainment    Total 131.5   FALSE      FALSE
#> 10 Entertainment  Iceland  16.8    TRUE       TRUE
#> 11 Entertainment Portugal   9.4    TRUE       TRUE
#> 12 Entertainment    Spain 105.3   FALSE       TRUE
#> 13  Governmental    Total  32.8   FALSE       TRUE
#> 14  Governmental  Iceland   0.0   FALSE      FALSE
#> 15  Governmental Portugal  23.6    TRUE       TRUE
#> 16  Governmental    Spain   9.2    TRUE       TRUE
#> 17      Industry    Total  57.8   FALSE       TRUE
#> 18      Industry  Iceland  20.3   FALSE      FALSE
#> 19      Industry Portugal  29.1   FALSE      FALSE
#> 20      Industry    Spain   8.4    TRUE       TRUE

# Industry:Portugal primary, but not suppressed
a4 <- SuppressDominantCells(data = dataset, numVar = "value", 
       dimVar = c("sector4", "geo"), n = 1:2, k = c(77, 99), 
       wg = wg, forced = ForcedWg, whenPrimaryForced = message)
#> [extraAggregate 20*3->10*4] Checking ....
#> Primary suppression of forced cells ignored
#> GaussSuppression_numttHTT: ........:::::
a4
#>          sector4      geo value primary forced unsafe suppressed
#> 1          Total    Total 462.3   FALSE  FALSE  FALSE      FALSE
#> 2          Total  Iceland  37.1   FALSE  FALSE  FALSE       TRUE
#> 3          Total Portugal 162.5   FALSE  FALSE  FALSE       TRUE
#> 4          Total    Spain 262.7   FALSE  FALSE  FALSE      FALSE
#> 5    Agriculture    Total 240.2   FALSE  FALSE  FALSE      FALSE
#> 6    Agriculture  Iceland   0.0   FALSE  FALSE  FALSE      FALSE
#> 7    Agriculture Portugal 100.4    TRUE  FALSE  FALSE       TRUE
#> 8    Agriculture    Spain 139.8    TRUE  FALSE  FALSE       TRUE
#> 9  Entertainment    Total 131.5   FALSE  FALSE  FALSE      FALSE
#> 10 Entertainment  Iceland  16.8    TRUE  FALSE  FALSE       TRUE
#> 11 Entertainment Portugal   9.4    TRUE  FALSE  FALSE       TRUE
#> 12 Entertainment    Spain 105.3   FALSE  FALSE  FALSE       TRUE
#> 13  Governmental    Total  32.8   FALSE  FALSE  FALSE       TRUE
#> 14  Governmental  Iceland   0.0   FALSE  FALSE  FALSE      FALSE
#> 15  Governmental Portugal  23.6    TRUE  FALSE  FALSE       TRUE
#> 16  Governmental    Spain   9.2    TRUE  FALSE  FALSE       TRUE
#> 17      Industry    Total  57.8   FALSE  FALSE  FALSE       TRUE
#> 18      Industry  Iceland  20.3   FALSE   TRUE  FALSE      FALSE
#> 19      Industry Portugal  29.1    TRUE   TRUE  FALSE      FALSE
#> 20      Industry    Spain   8.4    TRUE  FALSE  FALSE       TRUE