detangles: Revert anonymized point patterns or raster objects

Description Usage Arguments Value Note Author(s) References Examples

View source: R/detangles.R

Description

Anonymized spatial data can be reverted back to their original coordinates with a given detangler object. For correct re-identification, there is an assumed match in the hash key between anonymized data and detangler object.

Usage

1
2
3
detangles(data=NULL, tanglerInfo=NULL, raster_object = FALSE, 
stub = NULL, hash_key=NULL, 
saveTangles = FALSE, path = NULL)

Arguments

data

Can be either a 2 column matrix of spatial coordinates or a raster object.

tanglerInfo

output from tangles which encodes the steps and values of the re-identification process.

raster_object

logical; If TRUE the data to be re-identified is a raster object. This means the data associated with the raster are carried through to the outputs.

stub

Character; A string of user-defined setting for establishing naming conventions.

hash_key

Character; A string of the hash key that was used for the original anonymization.

saveTangles

logical; Save function output to file. Default is FALSE, but it is recommended to always save outputs.

path

character; Path to where outputs are saved.

Value

The transformed coordinates or raster object (dependent on input data).

Note

Outputs can be saved to any specified directory with the hash key associated with the detangler object and user-defined stub in the file name. This will be saved as an .rds file.

Author(s)

Brendan Malone

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## POINT DATA tangles
library(digest)
data("HV_subsoilpH")
str(HV_subsoilpH)
dat.xy<- HV_subsoilpH[,1:2]
xyData<- as.matrix(dat.xy)

# anonymize with 5 levels of abstraction
tangles.out<- tangles(data = xyData, 
depth = 5, 
rasterdata = TRUE, 
raster_object = FALSE,
saveTangles = FALSE)

# detangle
xyData<- as.matrix(tangles.out[[1]])

point_detang<- detangles(data=xyData, 
tanglerInfo=tangles.out[[2]], 
raster_object = FALSE, 
stub = "hv_fix", 
hash_key = tangles.out[[2]][1],
saveTangles = FALSE)

tangles documentation built on Oct. 11, 2019, 5:06 p.m.