is_sensitive: Return raster with sensitive locations.

View source: R/is_sensitive.R

is_sensitiveR Documentation

Return raster with sensitive locations.

Description

Create a binary raster with sensitive locations.

Usage

is_sensitive(
  x,
  max_risk = x$max_risk,
  min_count = x$min_count,
  risk_type = x$risk_type
)

Arguments

x

sdc_raster object.

max_risk

a risk value higher than max_risk will be sensitive.

min_count

a count lower than min_count will be sensitive.

risk_type

what kind of measure should be used (see details).

Details

By default the risk settings are taken from x, but they can be overriden.

Different risk functions can be used:

  • external (numeric variable), calculates how much the largest value comprises the total sum

  • internal (numeric variable), calculates how much the largest value comprises the sum without the second largest value

  • discrete (logical variable), calculates the fraction of sensitive values.

See Also

Other sensitive: disclosure_risk(), is_sensitive_at(), plot_sensitive(), remove_sensitive(), sdc_raster(), sensitivity_score()

Examples


dwellings_sp <- dwellings
sp::coordinates(dwellings_sp) <- ~ x + y
tryCatch(
  # does not work on some OS versions
  sp::proj4string(dwellings_sp) <- "+init=epsg:28992"
)
# create a 1km grid
unemployed <- sdc_raster(dwellings_sp, dwellings_sp$unemployed, r = 1e3)
print(unemployed)

# retrieve the sensitive cells
is_sensitive(unemployed)


sdcSpatial documentation built on March 24, 2022, 5:05 p.m.