tangler: Spatial point patterns and raster objects anonymized with a...

Description Usage Arguments Value Note Author(s) References Examples

View source: R/tangler.R

Description

For a given detangler object, spatial coordinates are anonymized accordingly.

Usage

1
2
tangler(data=NULL, tanglerInfo = NULL, raster_object = FALSE, stub = 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 anonymization process.

raster_object

logical; If TRUE the data to be anonymized 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.

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 also saved to any specified directory with the hash key associated with the anonymization and user-defined stub in the file name. This will be saved as an .rds file that will also have tanglerXY in the file name.

tangles is coordinate reference system agnostic. Anonymization will proceed regardless of whether data is in geographic or projected space. Anonymized coordinates will not exist in reality, but the spatial properties of the original data will be maintained.

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
24
## 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)


# tangle associated RASTER DATA
library(raster)
data("hunterCovariates_sub")

tangled.origi<- tangler(data = hunterCovariates_sub, 
tanglerInfo = tangles.out[[2]], 
raster_object = TRUE, 
stub = "hv1", 
saveTangles = FALSE)

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